✌️
This commit is contained in:
@@ -22,7 +22,7 @@ export class FederatedInstanceService {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async registerOrFetchInstanceDoc(host: string): Promise<Instance> {
|
||||
public async fetch(host: string): Promise<Instance> {
|
||||
host = this.utilityService.toPuny(host);
|
||||
|
||||
const cached = this.cache.get(host);
|
||||
@@ -44,4 +44,17 @@ export class FederatedInstanceService {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async updateCachePartial(host: string, data: Partial<Instance>): Promise<void> {
|
||||
host = this.utilityService.toPuny(host);
|
||||
|
||||
const cached = this.cache.get(host);
|
||||
if (cached == null) return;
|
||||
|
||||
this.cache.set(host, {
|
||||
...cached,
|
||||
...data,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user