Skip to content

Commit

Permalink
make loading of known event ids sync
Browse files Browse the repository at this point in the history
  • Loading branch information
pablof7z committed Feb 1, 2025
1 parent adbeef6 commit d9c6ad3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ndk-mobile/src/cache-adapter/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,15 @@ export class NDKCacheAdapterSqlite implements NDKCacheAdapter {
});
}

// console.log(`[${Date.now()}] [SQLITE] Cache adapter ready`);
this.ready = true;
this.locking = true;

// load all the event timestamps
const events = await this.db.getAllAsync(`SELECT id, created_at FROM events`) as {id: string, created_at: number}[];
const events = this.db.getAllSync(`SELECT id, created_at FROM events`) as {id: string, created_at: number}[];
for (const event of events) {
this.knownEventTimestamps.set(event.id, event.created_at);
}

await this.loadUnpublishedEvents();

Promise.all(this.pendingCallbacks.map((f) => {
Expand Down

0 comments on commit d9c6ad3

Please sign in to comment.