Compare commits
1 Commits
3c020d25ed
...
e644475fbc
| Author | SHA1 | Date | |
|---|---|---|---|
| e644475fbc |
@@ -42,6 +42,14 @@ async function run() {
|
|||||||
// initial kickoff
|
// initial kickoff
|
||||||
await fetchAndIndex().catch(handleError);
|
await fetchAndIndex().catch(handleError);
|
||||||
|
|
||||||
|
// listen for termination
|
||||||
|
const terminate = type => () => {
|
||||||
|
console.log(`Terminating [${type}]`);
|
||||||
|
process.exit(0);
|
||||||
|
};
|
||||||
|
process.on('SIGINT', terminate('SIGINT'));
|
||||||
|
process.on('SIGTERM', terminate('SIGTERM'));
|
||||||
|
|
||||||
// scheduled running
|
// scheduled running
|
||||||
if (interval === 0) return;
|
if (interval === 0) return;
|
||||||
logger.debug(`Starting interval (${interval}s)...`);
|
logger.debug(`Starting interval (${interval}s)...`);
|
||||||
|
|||||||
Reference in New Issue
Block a user