Meaningful log message for high resource usage errors
This commit is contained in:
@@ -156,7 +156,8 @@ const workerFun = async (queue: Queue, jobProcessor: (token: string, job: Job) =
|
|||||||
const canAcceptConnection = await monitor.acceptConnection();
|
const canAcceptConnection = await monitor.acceptConnection();
|
||||||
|
|
||||||
if (!canAcceptConnection) {
|
if (!canAcceptConnection) {
|
||||||
logger.info("Cant accept connection");
|
console.log("Can't accept connection due to RAM/CPU load");
|
||||||
|
logger.info("Can't accept connection due to RAM/CPU load");
|
||||||
cantAcceptConnectionCount++;
|
cantAcceptConnectionCount++;
|
||||||
|
|
||||||
if (cantAcceptConnectionCount >= 25) {
|
if (cantAcceptConnectionCount >= 25) {
|
||||||
|
|||||||
@@ -567,7 +567,8 @@ const workerFun = async (
|
|||||||
const token = uuidv4();
|
const token = uuidv4();
|
||||||
const canAcceptConnection = await monitor.acceptConnection();
|
const canAcceptConnection = await monitor.acceptConnection();
|
||||||
if (!canAcceptConnection) {
|
if (!canAcceptConnection) {
|
||||||
console.log("Cant accept connection");
|
console.log("Can't accept connection due to RAM/CPU load");
|
||||||
|
logger.info("Can't accept connection due to RAM/CPU load");
|
||||||
cantAcceptConnectionCount++;
|
cantAcceptConnectionCount++;
|
||||||
|
|
||||||
if (cantAcceptConnectionCount >= 25) {
|
if (cantAcceptConnectionCount >= 25) {
|
||||||
|
|||||||
Reference in New Issue
Block a user