refactor: tweak profile loader
This commit is contained in:
@ -79,6 +79,9 @@ export abstract class BackgroundLoader<T extends { loaded: number; created: numb
|
||||
resolve(existing);
|
||||
this.UntrackKeys(key);
|
||||
this.cache.off("change", handler);
|
||||
} else {
|
||||
// should never happen
|
||||
reject(new Error("Not found"));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { unixNowMs } from "@snort/shared";
|
||||
import { EventKind, TaggedNostrEvent, RequestBuilder } from ".";
|
||||
import { MetadataRelays, ProfileCacheExpire } from "./const";
|
||||
import { ProfileCacheExpire } from "./const";
|
||||
import { mapEventToProfile, CachedMetadata } from "./cache";
|
||||
import { BackgroundLoader } from "./background-loader";
|
||||
|
||||
@ -19,7 +19,7 @@ export class ProfileLoaderService extends BackgroundLoader<CachedMetadata> {
|
||||
|
||||
override buildSub(missing: string[]): RequestBuilder {
|
||||
const sub = new RequestBuilder(`profiles`);
|
||||
sub.withFilter().kinds([EventKind.SetMetadata]).authors(missing).relay(MetadataRelays);
|
||||
sub.withFilter().kinds([EventKind.SetMetadata]).authors(missing);
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user