mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(server): same identify across pods (#9428)
This commit is contained in:
@@ -14,6 +14,7 @@ export const MUTEX_WAIT = 100;
|
||||
@Injectable()
|
||||
export class Mutex {
|
||||
protected logger = new Logger(Mutex.name);
|
||||
private readonly clusterIdentifier = `cluster:${randomUUID()}`;
|
||||
|
||||
constructor(protected readonly locker: Locker) {}
|
||||
|
||||
@@ -38,7 +39,7 @@ export class Mutex {
|
||||
* @param key resource key
|
||||
* @returns LockGuard
|
||||
*/
|
||||
async acquire(key: string, owner: string = 'global') {
|
||||
async acquire(key: string, owner: string = this.clusterIdentifier) {
|
||||
try {
|
||||
return await retryable(
|
||||
() => this.locker.lock(owner, key),
|
||||
|
||||
Reference in New Issue
Block a user