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
1 changed files with 6 additions and 3 deletions

View File

@ -358,15 +358,18 @@ def main():
out_filter = OutFilter(chain_spec, rules_filter=address_rules, renderers=renderers_mods)
filters.append(out_filter)
cache_rpc = CacheRPC(rpc, store)
use_rpc = rpc
if not args.fresh:
use_rpc = CacheRPC(rpc, store)
i = 0
for syncer in syncers:
logg.info('running syncer index {} {}'.format(i, str(syncer)))
for f in filters:
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))
i += 1