4
0
mirror of git://holbrook.no/eth-monitor.git synced 2024-11-24 04:26:46 +01:00

Implement 'fresh' flag

This commit is contained in:
lash 2022-02-27 14:21:09 +00:00
parent aabc632d8d
commit c760c3800c
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -358,15 +358,18 @@ def main():
out_filter = OutFilter(chain_spec, rules_filter=address_rules, renderers=renderers_mods) out_filter = OutFilter(chain_spec, rules_filter=address_rules, renderers=renderers_mods)
filters.append(out_filter) filters.append(out_filter)
cache_rpc = CacheRPC(rpc, store) use_rpc = rpc
if not args.fresh:
use_rpc = CacheRPC(rpc, store)
i = 0 i = 0
for syncer in syncers: for syncer in syncers:
logg.info('running syncer index {} {}'.format(i, str(syncer))) logg.info('running syncer index {} {}'.format(i, str(syncer)))
for f in filters: for f in filters:
syncer.add_filter(f) syncer.add_filter(f)
r = syncer.loop(int(config.get('SYNCER_LOOP_INTERVAL')), cache_rpc) r = syncer.loop(int(config.get('SYNCER_LOOP_INTERVAL')), use_rpc)
sys.stderr.write("sync {} done at block {}\n".format(syncer, r)) sys.stderr.write("sync {} done at block {}\n".format(syncer, r))
i += 1 i += 1