From 50a0a5d4d80c39b0d6ef47a7036bb3a23a23cb8a Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Sat, 4 May 2024 17:50:56 -0500 Subject: [PATCH] Use promise rather than callback mode for fastq --- backend/src/matrix-bot/outbound-queue.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/matrix-bot/outbound-queue.js b/backend/src/matrix-bot/outbound-queue.js index 0d0864f..bdf08b9 100644 --- a/backend/src/matrix-bot/outbound-queue.js +++ b/backend/src/matrix-bot/outbound-queue.js @@ -23,7 +23,7 @@ const processOutboundQueue = async ({ type, ...args }) => { } }; -const outboundQueue = fastq(processOutboundQueue, 1); +const outboundQueue = fastq.promise(processOutboundQueue, 1); // Pause outbound queue until matrixClient and targetRoomId are set outboundQueue.pause(); @@ -32,6 +32,7 @@ const setTargetRoomId = async (roomId) => { console.log('target room ID:', targetRoomId); await applicationData.put('targetRoomId', targetRoomId); if (matrixClient) { + console.log('Starting Matrix outbound queue processor'); outboundQueue.resume(); } }; @@ -46,6 +47,7 @@ const initializeOutboundQueue = async (matrixClient_) => { console.warn('target room ID is not set -- will not be able to send messages until it is set. Use !target '); } if (targetRoomId) { + console.log('Starting Matrix outbound queue processor'); outboundQueue.resume(); } };