fix(infra): failed to get status when database not ready (#7470)

This commit is contained in:
EYHN
2024-07-11 06:40:35 +00:00
parent c850dbb2b7
commit c2f93f9512

View File

@@ -238,6 +238,7 @@ export class IndexedDBJobQueue<J> implements JobQueue<J> {
throttleTime(300, undefined, { leading: true, trailing: true }),
exhaustMapWithTrailing(() =>
fromPromise(async () => {
await this.ensureInitialized();
const trx = this.database.transaction(['jobs'], 'readonly');
const remaining = await trx.objectStore('jobs').count();
return { remaining };