sql_channel: Ensure we save reference to MultipleQueue to start

This commit is contained in:
Scott Nonnenberg 2019-09-20 11:30:55 -07:00
parent 2a7cfd9776
commit 9db42bc4c6

View file

@ -73,12 +73,14 @@ function initialize() {
makeNewMultipleQueue();
multipleQueue.pause();
const multipleQueueRef = multipleQueue;
const singleQueueRef = singleQueue;
singleQueue = null;
const promise = multipleQueue.add(() => fn(...args));
const promise = multipleQueueRef.add(() => fn(...args));
await singleQueueRef.onIdle();
multipleQueue.start();
multipleQueueRef.start();
result = await promise;
} else {
makeNewMultipleQueue();