Skip to content

Commit 96be484

Browse files
committed
daily shovels should run once every 7200 blocks
1 parent 56b030e commit 96be484

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

scraper_service/shovel_daily_balance/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
logging.basicConfig(level=logging.INFO,
1111
format="%(asctime)s %(process)d %(message)s")
1212

13+
BLOCKS_PER_DAY = 7200
14+
1315
class BalanceDailyMapShovel(ShovelBaseClass):
1416
table_name = "shovel_balance_daily_map"
1517

@@ -18,6 +20,8 @@ def process_block(self, n):
1820

1921

2022
def do_process_block(n, table_name):
23+
if n % BLOCKS_PER_DAY != 0:
24+
return
2125
try:
2226
# Create table if it doesn't exist
2327
try:

scraper_service/shovel_daily_stake/main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
logging.basicConfig(level=logging.INFO,
1212
format="%(asctime)s %(process)d %(message)s")
1313

14+
BLOCKS_PER_DAY = 7200
15+
1416
class StakeDailyMapShovel(ShovelBaseClass):
1517
table_name = "shovel_stake_daily_map"
1618

@@ -19,6 +21,8 @@ def process_block(self, n):
1921

2022

2123
def do_process_block(n, table_name):
24+
if n % BLOCKS_PER_DAY != 0:
25+
return
2226
try:
2327
# Create table if it doesn't exist
2428
try:

0 commit comments

Comments
 (0)