mirror of
https://github.com/fosrl/pangolin.git
synced 2026-10-28 22:49:07 +01:00
Improve latency on register messages for olm
This commit is contained in:
@@ -110,6 +110,21 @@ export class LockManager {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether any of the given locks currently exist
|
||||
* @param lockKeys - Unique identifiers for the locks
|
||||
* @returns Promise<boolean> - true if at least one lock is held
|
||||
*/
|
||||
async anyLockExists(lockKeys: string[]): Promise<boolean> {
|
||||
for (const lockKey of lockKeys) {
|
||||
this.clearExpiredLocalLock(lockKey);
|
||||
if (localLocks.has(lockKey)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extend the TTL of an existing lock, provided the token matches the
|
||||
* acquisition currently holding it.
|
||||
|
||||
Reference in New Issue
Block a user