mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-07-04 19:32:01 +00:00
SIGUSR1 should cause fs to commence drying up calls but do not exit when call count reaches zero (#1486)
This commit is contained in:
+2
-11
@@ -120,17 +120,8 @@ module.exports = (logger) => {
|
|||||||
}
|
}
|
||||||
pingProxies(srf);
|
pingProxies(srf);
|
||||||
|
|
||||||
// if we have zero calls, we can complete the scale-in right
|
// Note: in response to SIGUSR1 we start drying up but do not exit when calls reach zero.
|
||||||
setTimeout(() => {
|
// This is to allow external scripts that sent the signal to manage the lifecycle.
|
||||||
const calls = srf.locals.sessionTracker.count;
|
|
||||||
if (calls === 0) {
|
|
||||||
logger.info('scale-in can complete immediately as we have no calls in progress');
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
logger.info(`${calls} calls in progress; scale-in will complete when they are done`);
|
|
||||||
}
|
|
||||||
}, 5000);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user