|
@@ -392,17 +392,18 @@ class WorkflowEngine {
|
|
await browser.storage.local.set({ workflowQueue });
|
|
await browser.storage.local.set({ workflowQueue });
|
|
}
|
|
}
|
|
|
|
|
|
- destroyWorker(workerId) {
|
|
|
|
- this.workers.delete(workerId);
|
|
|
|
-
|
|
|
|
- if (this.workers.size === 0) {
|
|
|
|
|
|
+ async destroyWorker(workerId) {
|
|
|
|
+ // is last worker
|
|
|
|
+ if (this.workers.size === 1 && this.workers.has(workerId)) {
|
|
this.addLogHistory({
|
|
this.addLogHistory({
|
|
type: 'finish',
|
|
type: 'finish',
|
|
name: 'finish',
|
|
name: 'finish',
|
|
});
|
|
});
|
|
this.dispatchEvent('finish');
|
|
this.dispatchEvent('finish');
|
|
- this.destroy('success');
|
|
|
|
|
|
+ await this.destroy('success');
|
|
}
|
|
}
|
|
|
|
+ // wait detach debugger
|
|
|
|
+ this.workers.delete(workerId);
|
|
}
|
|
}
|
|
|
|
|
|
async destroy(status, message, blockDetail) {
|
|
async destroy(status, message, blockDetail) {
|