Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
timothe
duniter
Commits
fa26f782
Commit
fa26f782
authored
Aug 06, 2017
by
Cédric Moreau
Browse files
[fix] #1036 Pull sandboxes from the network 10 minutes after the start
parent
9935067f
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/modules/crawler/lib/constants.ts
View file @
fa26f782
...
...
@@ -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
...
...
app/modules/crawler/lib/crawler.ts
View file @
fa26f782
...
...
@@ -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
()
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment