Commit fa26f782 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1036 Pull sandboxes from the network 10 minutes after the start

parent 9935067f
......@@ -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
......
......@@ -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() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment