Add RUN_ON_START
This commit is contained in:
parent
8f6dfc03d9
commit
120c0e3b68
2 changed files with 6 additions and 3 deletions
|
|
@ -1,9 +1,10 @@
|
|||
exports.CONFIG = {
|
||||
MAIN: {
|
||||
NODE_ENV: 'production', // Environment mode: 'production' or 'development'
|
||||
CLOUDFLARE_ZONE_ID: '00000000000000000000000000000000', // https://dash.cloudflare.com/profile/api-tokens
|
||||
CLOUDFLARE_API_KEY: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // API key for Cloudflare access
|
||||
CLOUDFLARE_ZONE_ID: '00000000000000000000000000000000', // API key for Cloudflare access
|
||||
CLOUDFLARE_API_KEY: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // https://dash.cloudflare.com/profile/api-tokens
|
||||
ABUSEIPDB_API_KEY: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // API key for reporting malicious IPs to AbuseIPDB
|
||||
RUN_ON_START: true, // Should the reporting function run immediately after the script starts?
|
||||
},
|
||||
|
||||
CYCLES: {
|
||||
|
|
|
|||
4
index.js
4
index.js
|
|
@ -168,7 +168,9 @@ const cron = async () => {
|
|||
// Ready
|
||||
process.send && process.send('ready');
|
||||
|
||||
log(0, 'The integration is ready!');
|
||||
|
||||
// AbuseIPDB
|
||||
new CronJob(CONFIG.CYCLES.REPORT_SCHEDULE, cron, null, true, 'UTC');
|
||||
await cron();
|
||||
if (CONFIG.MAIN.RUN_ON_START) await cron();
|
||||
})();
|
||||
Loading…
Add table
Reference in a new issue