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