Use promise rather than callback mode for fastq
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 40s Details

This commit is contained in:
Ladd Hoffman 2024-05-04 17:50:56 -05:00
parent 890d5d3c14
commit 50a0a5d4d8
1 changed files with 3 additions and 1 deletions

View File

@ -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 <bot-id>');
}
if (targetRoomId) {
console.log('Starting Matrix outbound queue processor');
outboundQueue.resume();
}
};