From b80277d4de1e9101482d4ec3856cfed05d1ed95e Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 23 Aug 2024 22:46:44 -0300 Subject: [PATCH] Update queue.ts --- apps/api/src/controllers/admin/queue.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api/src/controllers/admin/queue.ts b/apps/api/src/controllers/admin/queue.ts index 2923ebba..6a46cfec 100644 --- a/apps/api/src/controllers/admin/queue.ts +++ b/apps/api/src/controllers/admin/queue.ts @@ -113,7 +113,7 @@ export async function autoscalerController(req: Request, res: Response) { const machines = await request.json(); // Only worker machines - const activeMachines = machines.filter(machine => (machine.state === 'started' || machine.state === "starting") && machine.config.env["FLY_PROCESS_GROUP"] === "worker").length; + const activeMachines = machines.filter(machine => (machine.state === 'started' || machine.state === "starting" || machine.state === "replacing") && machine.config.env["FLY_PROCESS_GROUP"] === "worker").length; let targetMachineCount = activeMachines; @@ -143,9 +143,9 @@ export async function autoscalerController(req: Request, res: Response) { Logger.info(`🐂 Scaling from ${activeMachines} to ${targetMachineCount} - ${webScraperActive} active, ${webScraperWaiting} waiting`); if(targetMachineCount > activeMachines) { - sendSlackWebhook("🐂 Scaling up to " + targetMachineCount + " machines", false, process.env.SLACK_AUTOSCALER ?? ""); + sendSlackWebhook(`🐂 Scaling from ${activeMachines} to ${targetMachineCount} - ${webScraperActive} active, ${webScraperWaiting} waiting`, false, process.env.SLACK_AUTOSCALER ?? ""); } else { - sendSlackWebhook("🐂 Scaling down to " + targetMachineCount + " machines", false, process.env.SLACK_AUTOSCALER ?? ""); + sendSlackWebhook(`🐂 Scaling from ${activeMachines} to ${targetMachineCount} - ${webScraperActive} active, ${webScraperWaiting} waiting`, false, process.env.SLACK_AUTOSCALER ?? ""); } return res.status(200).json({ mode: "scale-descale",