daemonization changes for storage calculations

merge-requests/4/head
Matthew 2020-06-29 23:57:30 -04:00
parent 8378b27c96
commit 00dde49d79
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@ export default async function storage(client: Client) {
client.signale.log(`Go storage func exited with code ${code}, restarting`); client.signale.log(`Go storage func exited with code ${code}, restarting`);
storageGo = spawn(`${__dirname}/../bin/storage`, [], { cwd: __dirname }); storageGo = spawn(`${__dirname}/../bin/storage`, [], { cwd: __dirname });
}); */ }); */
client.signale.info(`Activated CSD-GO-STR daemon startup interval. Starting in ${intervalTiming / 60000}min.`);
interval = setInterval(async () => { interval = setInterval(async () => {
intervalTiming = await determineInterval(client); intervalTiming = await determineInterval(client);
const storageDaemon = spawn(`${__dirname}/../bin/storage`, [], { cwd: __dirname }); const storageDaemon = spawn(`${__dirname}/../bin/storage`, [], { cwd: __dirname });
@ -26,6 +27,7 @@ export default async function storage(client: Client) {
storageDaemon.on('exit', (code) => { storageDaemon.on('exit', (code) => {
client.signale.log(`CSD-GO-STR Daemon exited with code ${code}.`); client.signale.log(`CSD-GO-STR Daemon exited with code ${code}.`);
storageDaemon.removeAllListeners(); storageDaemon.removeAllListeners();
client.signale.info(`Reactivating CSD-GO-STR daemon startup interval. Reactivating in ${intervalTiming / 60000}min.`);
}); });
}, intervalTiming); }, intervalTiming);
} }