mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-06 05:38:10 +08:00
Update queue.ts
This commit is contained in:
parent
d87b62fed9
commit
b80277d4de
@ -113,7 +113,7 @@ export async function autoscalerController(req: Request, res: Response) {
|
|||||||
const machines = await request.json();
|
const machines = await request.json();
|
||||||
|
|
||||||
// Only worker machines
|
// 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;
|
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`);
|
Logger.info(`🐂 Scaling from ${activeMachines} to ${targetMachineCount} - ${webScraperActive} active, ${webScraperWaiting} waiting`);
|
||||||
|
|
||||||
if(targetMachineCount > activeMachines) {
|
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 {
|
} 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({
|
return res.status(200).json({
|
||||||
mode: "scale-descale",
|
mode: "scale-descale",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user