feat(core): run indexer in worker (#7418)

This commit is contained in:
liuyi
2024-07-04 15:37:26 +08:00
committed by GitHub
parent 5c1f78afd4
commit 555f203be6
15 changed files with 717 additions and 362 deletions
@@ -155,6 +155,9 @@ export class IndexedDBJobQueue<J> implements JobQueue<J> {
.objectStore('jobs')
.delete(typeof id === 'string' ? parseInt(id) : id);
}
trx.commit();
this.broadcast.postMessage('job-completed');
}
async return(jobs: Job[], retry: boolean = false): Promise<void> {
@@ -174,6 +177,10 @@ export class IndexedDBJobQueue<J> implements JobQueue<J> {
.delete(typeof id === 'string' ? parseInt(id) : id);
}
}
trx.commit();
this.broadcast.postMessage('job-completed');
}
async clear(): Promise<void> {
+1 -1
View File
@@ -29,7 +29,7 @@ export class JobRunner<J> {
}
stop() {
this.abort?.abort();
this.abort?.abort(MANUALLY_STOP);
this.abort = null;
}