Files
outline/server/utils/__mocks__/MutexLock.ts
T
Tom Moor 201fbb56eb perf: Add cache for document structure (#9196)
* Normalize Collection.findByPk

* Add caching of documentStructure

* fix: Do not set cache before transaction is flushed

* Mock Redis
2025-05-18 18:45:00 -04:00

19 lines
414 B
TypeScript

export class MutexLock {
// Default expiry time for acquiring lock in milliseconds
public static defaultLockTimeout = 4000;
/**
* Returns the mock redlock instance
*/
public static get lock() {
return {
acquire: jest.fn().mockResolvedValue({
release: jest.fn().mockResolvedValue(true),
expiration: Date.now() + 10000,
}),
};
}
private static redlock: any;
}