refactor: prevent duplicate preload
This commit is contained in:
parent
a54924f339
commit
08241bbbf6
@ -42,9 +42,12 @@ export abstract class FeedCache<TCached> {
|
||||
}
|
||||
|
||||
async preload() {
|
||||
// assume already preloaded if keys exist on table in memory
|
||||
if (this.onTable.size === 0) {
|
||||
const keys = (await this.table?.toCollection().primaryKeys()) ?? [];
|
||||
this.onTable = new Set<string>(keys.map(a => a as string));
|
||||
}
|
||||
}
|
||||
|
||||
keysOnTable() {
|
||||
return [...this.onTable];
|
||||
|
Loading…
Reference in New Issue
Block a user