Merge pull request #902 from bluewave-labs/feat/jobqueue-delete

Scale workers on deleting job
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-09-30 22:58:46 -07:00
commit 3a31387d00
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -139,7 +139,7 @@ class JobQueue {
return { jobs, load }; return { jobs, load };
} catch (error) { } catch (error) {
error.service === undefined ? (error.service = SERVICE_NAME) : null; error.service === undefined ? (error.service = SERVICE_NAME) : null;
errorObject.method === undefined error.method === undefined
? (error.method = "getWorkerStats") ? (error.method = "getWorkerStats")
: null; : null;
throw error; throw error;
@@ -285,6 +285,8 @@ class JobQueue {
service: SERVICE_NAME, service: SERVICE_NAME,
jobId: monitor.id, jobId: monitor.id,
}); });
const workerStats = await this.getWorkerStats();
await this.scaleWorkers(workerStats);
} else { } else {
logger.error(errorMessages.JOB_QUEUE_DELETE_JOB, { logger.error(errorMessages.JOB_QUEUE_DELETE_JOB, {
service: SERVICE_NAME, service: SERVICE_NAME,
+1 -1
View File
@@ -1,5 +1,5 @@
const { env } = require("process"); const { env } = require("process");
const AppSettings = require("../models/AppSettings"); const AppSettings = require("../db/models/AppSettings");
const SERVICE_NAME = "SettingsService"; const SERVICE_NAME = "SettingsService";
const envConfig = { const envConfig = {
logLevel: undefined, logLevel: undefined,