Update index.ts

This commit is contained in:
Nicolas 2024-07-12 19:57:12 -04:00
parent da3e6525a9
commit bfc7f5882e
1 changed files with 3 additions and 1 deletions

View File

@ -35,7 +35,9 @@ export async function checkAlerts() {
const checkWaitingQueue = async () => {
const webScraperQueue = getWebScraperQueue();
const waitingJobs = await webScraperQueue.getWaitingCount();
if (waitingJobs > Number(process.env.ALERT_NUM_WAITING_JOBS)) {
const paused = await webScraperQueue.getPausedCount();
if (waitingJobs !== paused && waitingJobs > Number(process.env.ALERT_NUM_WAITING_JOBS)) {
console.warn(
`Alert: Number of waiting jobs is over ${process.env.ALERT_NUM_WAITING_JOBS}. Current waiting jobs: ${waitingJobs}.`
);