From 66782f05a7e590c1f397237157e03be2772dfe9b Mon Sep 17 00:00:00 2001 From: Sefinek Date: Sat, 14 Sep 2024 13:27:56 +0200 Subject: [PATCH] Update --- index.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index e5f0a08..84475e2 100644 --- a/index.js +++ b/index.js @@ -91,14 +91,6 @@ const reportIP = async (event, country, hostname, endpoint, userAgent, cycleErro }; (async () => { - if (process.env.NODE_ENV === 'production') { - try { - process.send('ready'); - } catch (err) { - log('log', `Failed to send ready signal to parent process. ${err.message}`); - } - } - log('log', 'Loading data, please wait...'); await clientIp.fetchIPAddress(); @@ -107,6 +99,15 @@ const reportIP = async (event, country, hostname, endpoint, userAgent, cycleErro setInterval(async () => await SefinekAPI(), SEFINEK_API_INTERVAL); } + // Ready + if (process.env.NODE_ENV === 'production') { + try { + process.send('ready'); + } catch (err) { + log('log', `Failed to send ready signal to parent process. ${err.message}`); + } + } + // AbuseIPDB let cycleId = 1; while (true) {