sql_channel: Ensure we save reference to MultipleQueue to start
This commit is contained in:
parent
2a7cfd9776
commit
9db42bc4c6
1 changed files with 4 additions and 2 deletions
|
@ -73,12 +73,14 @@ function initialize() {
|
||||||
makeNewMultipleQueue();
|
makeNewMultipleQueue();
|
||||||
multipleQueue.pause();
|
multipleQueue.pause();
|
||||||
|
|
||||||
|
const multipleQueueRef = multipleQueue;
|
||||||
const singleQueueRef = singleQueue;
|
const singleQueueRef = singleQueue;
|
||||||
|
|
||||||
singleQueue = null;
|
singleQueue = null;
|
||||||
const promise = multipleQueue.add(() => fn(...args));
|
const promise = multipleQueueRef.add(() => fn(...args));
|
||||||
await singleQueueRef.onIdle();
|
await singleQueueRef.onIdle();
|
||||||
|
|
||||||
multipleQueue.start();
|
multipleQueueRef.start();
|
||||||
result = await promise;
|
result = await promise;
|
||||||
} else {
|
} else {
|
||||||
makeNewMultipleQueue();
|
makeNewMultipleQueue();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue