Compare commits
1 Commits
7bbe31f4ea
...
e644475fbc
| Author | SHA1 | Date | |
|---|---|---|---|
| e644475fbc |
@@ -42,6 +42,14 @@ async function run() {
|
||||
// initial kickoff
|
||||
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
|
||||
if (interval === 0) return;
|
||||
logger.debug(`Starting interval (${interval}s)...`);
|
||||
|
||||
Reference in New Issue
Block a user