mirror of
https://github.com/mempool/mempool.git
synced 2026-08-18 13:08:44 +02:00
Upon error, re-run the PoolsUpdater within 24h instead of 7d
This commit is contained in:
parent
1969f2a275
commit
2d29b9ef89
1 changed files with 6 additions and 2 deletions
|
|
@ -18,8 +18,11 @@ class PoolsUpdater {
|
|||
return;
|
||||
}
|
||||
|
||||
const oneWeek = 604800;
|
||||
const oneDay = 86400;
|
||||
|
||||
const now = new Date().getTime() / 1000;
|
||||
if (now - this.lastRun < 604800) { // Execute the PoolsUpdate only once a week, or upon restart
|
||||
if (now - this.lastRun < oneWeek) { // Execute the PoolsUpdate only once a week, or upon restart
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +47,8 @@ class PoolsUpdater {
|
|||
logger.notice('PoolsUpdater completed');
|
||||
|
||||
} catch (e) {
|
||||
logger.err('PoolsUpdater failed. Error: ' + e);
|
||||
this.lastRun = now - oneWeek - oneDay; // Try again in 24h
|
||||
logger.err('PoolsUpdater failed. Will try again in 24h. Error: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue