🔧 Fixed an errant condition

This error was because I checked for active AND prioritized jobs in BullMQ, when none existed, because everything was active, and the socket.io event never fired, causing the browser to be in a bad state and never "resuming" an import even when one was in progress.
This commit is contained in:
2023-08-30 12:21:43 -04:00
parent 356b093db9
commit cfa09691e8

View File

@@ -47,9 +47,9 @@ export default class SocketService extends Service {
"jobqueue.getJobCountsByType",
{}
);
const { active, prioritized } = jobs;
const { active } = jobs;
if (active > 0 && prioritized > 0) {
if (active > 0) {
// 3. Get job counts
const completedJobCount =
await pubClient.get(
@@ -149,6 +149,7 @@ export default class SocketService extends Service {
console.log(
`Found socketId ${socket.id}, attempting to resume socket.io connection...`
);
console.log(socket.handshake.query.sessionId);
}
});
},