forked from engineering/cloudservices
changes to go func
parent
98ec12266d
commit
529a640d9e
|
@ -11,6 +11,17 @@ export default async function storage(client: Client) {
|
|||
return (accounts * 2) * 60000;
|
||||
}
|
||||
let intervalTiming = await determineInterval(client);
|
||||
|
||||
async function start() {
|
||||
const storageDaemon = spawn(`${__dirname}/../bin/storage`, [], { cwd: __dirname });
|
||||
storageDaemon.stdout.on('data', (data) => client.signale.log(data.toString()));
|
||||
storageDaemon.stderr.on('data', (data) => client.signale.log(data.toString()));
|
||||
storageDaemon.on('exit', (code) => {
|
||||
client.signale.log(`CSD-GO-STR Daemon exited with code ${code}.`);
|
||||
storageDaemon.removeAllListeners();
|
||||
client.signale.info(`Reactivating CSD-GO-STR daemon startup interval. Reactivating in ${intervalTiming / 60000}min.`);
|
||||
});
|
||||
}
|
||||
/* let storageGo = spawn(`${__dirname}/../bin/storage`, [], { cwd: __dirname });
|
||||
storageGo.stdout.on('data', (data) => client.signale.log(data.toString()));
|
||||
storageGo.stderr.on('data', (data) => client.signale.log(data.toString()));
|
||||
|
@ -21,14 +32,7 @@ export default async function storage(client: Client) {
|
|||
client.signale.info(`Activated CSD-GO-STR daemon startup interval. Starting in ${intervalTiming / 60000}min.`);
|
||||
interval = setInterval(async () => {
|
||||
intervalTiming = await determineInterval(client);
|
||||
const storageDaemon = spawn(`${__dirname}/../bin/storage`, [], { cwd: __dirname });
|
||||
storageDaemon.stdout.on('data', (data) => client.signale.log(data.toString()));
|
||||
storageDaemon.stderr.on('data', (data) => client.signale.log(data.toString()));
|
||||
storageDaemon.on('exit', (code) => {
|
||||
client.signale.log(`CSD-GO-STR Daemon exited with code ${code}.`);
|
||||
storageDaemon.removeAllListeners();
|
||||
client.signale.info(`Reactivating CSD-GO-STR daemon startup interval. Reactivating in ${intervalTiming / 60000}min.`);
|
||||
});
|
||||
await start();
|
||||
}, intervalTiming);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue