diff --git a/app/modules/crawler/lib/constants.ts b/app/modules/crawler/lib/constants.ts index 23ca184d4612a5e9ae21c658f65d94de41ee0c44..c8076b899675c504562dbca2c4f88affb86639db 100644 --- a/app/modules/crawler/lib/constants.ts +++ b/app/modules/crawler/lib/constants.ts @@ -12,6 +12,7 @@ export const CrawlerConstants = { PULLING_MINIMAL_DELAY: 20, PULLING_INTERVAL_TARGET: 240, COUNT_FOR_ENOUGH_PEERS: 4, + SANDBOX_FIRST_PULL_DELAY: 1000 * 60 * 10, // milliseconds SANDBOX_PEERS_COUNT: 2, SANDBOX_CHECK_INTERVAL: 288, // Every day (288 blocks = 1 day) TEST_PEERS_INTERVAL: 10, // In seconds diff --git a/app/modules/crawler/lib/crawler.ts b/app/modules/crawler/lib/crawler.ts index 494960a47d38dff07f9f62b5db8c663c40ac7d25..370ce2451bfbdb808c0370f3e05235932e9347e6 100644 --- a/app/modules/crawler/lib/crawler.ts +++ b/app/modules/crawler/lib/crawler.ts @@ -168,6 +168,9 @@ export class SandboxCrawler implements DuniterService { if (this.pullInterval) clearInterval(this.pullInterval); this.pullInterval = setInterval(() => this.pullFifo.push((cb:any) => this.sandboxPull(this.server).then(cb).catch(cb)), 1000 * this.conf.avgGenTime * CrawlerConstants.SANDBOX_CHECK_INTERVAL); + setTimeout(() => { + this.pullFifo.push((cb:any) => this.sandboxPull(this.server).then(cb).catch(cb)) + }, CrawlerConstants.SANDBOX_FIRST_PULL_DELAY) } async stopService() {