mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
201fbb56eb
* Normalize Collection.findByPk * Add caching of documentStructure * fix: Do not set cache before transaction is flushed * Mock Redis
19 lines
414 B
TypeScript
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;
|
|
}
|