Scale workers on deleting job

This commit is contained in:
Alex Holliday
2024-10-01 12:36:37 +08:00
parent fc84d8e986
commit 5b3b78bd3f
2 changed files with 4 additions and 2 deletions

View File

@@ -139,7 +139,7 @@ class JobQueue {
return { jobs, load };
} catch (error) {
error.service === undefined ? (error.service = SERVICE_NAME) : null;
errorObject.method === undefined
error.method === undefined
? (error.method = "getWorkerStats")
: null;
throw error;
@@ -285,6 +285,8 @@ class JobQueue {
service: SERVICE_NAME,
jobId: monitor.id,
});
const workerStats = await this.getWorkerStats();
await this.scaleWorkers(workerStats);
} else {
logger.error(errorMessages.JOB_QUEUE_DELETE_JOB, {
service: SERVICE_NAME,

View File

@@ -1,5 +1,5 @@
const { env } = require("process");
const AppSettings = require("../models/AppSettings");
const AppSettings = require("../db/models/AppSettings");
const SERVICE_NAME = "SettingsService";
const envConfig = {
logLevel: undefined,