Skip to content

Commit 7d976a9

Browse files
committed
exit alpha 2 tao shovel if run more ofthen than every hour
1 parent abe6cfe commit 7d976a9

File tree

1 file changed

+5
-0
lines changed
  • scraper_service/shovel_alpha_to_tao

1 file changed

+5
-0
lines changed

scraper_service/shovel_alpha_to_tao/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
logging.basicConfig(level=logging.INFO,
1414
format="%(asctime)s %(process)d %(message)s")
1515

16+
BLOCKS_AN_HOUR = (60 * 60) / 12
1617

1718
class AlphaToTaoShovel(ShovelBaseClass):
1819
table_name = "shovel_alpha_to_tao"
@@ -27,6 +28,10 @@ def process_block(self, n):
2728

2829

2930
def do_process_block(self, n):
31+
# We don't need this data every block.
32+
if n % BLOCKS_AN_HOUR != 0:
33+
return
34+
3035
try:
3136
substrate = get_substrate_client()
3237

0 commit comments

Comments
 (0)