Merge remote-tracking branch 'misskey-dev/develop' into io

This commit is contained in:
まっちゃとーにゅ 2024-03-05 15:49:07 +09:00
commit 9e63703d59
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB
35 changed files with 1455 additions and 1309 deletions

View file

@ -51,12 +51,14 @@ export class FetchInstanceMetadataService {
}
@bindThis
// public for test
public async tryLock(host: string): Promise<boolean> {
const mutex = await this.redisClient.set(`fetchInstanceMetadata:mutex:${host}`, Date.now(), 'EX', 60 * 5, 'NX');
return mutex !== null;
}
@bindThis
// public for test
public unlock(host: string): Promise<number> {
return this.redisClient.unlink(`fetchInstanceMetadata:mutex:${host}`);
}