Merge remote-tracking branch 'misskey-dev/develop' into io
This commit is contained in:
commit
9e63703d59
35 changed files with 1455 additions and 1309 deletions
|
@ -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}`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue