Update config handlnig

This commit is contained in:
lash 2022-05-14 16:14:16 +00:00
parent 1adecdde2d
commit cad695c676
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
1 changed files with 3 additions and 7 deletions

View File

@ -1,19 +1,15 @@
# external imports
from chainsyncer.cli import SyncFlag
def process_config(config, args, flags):
def process_config(config, arg, args, flags):
args_override = {}
args_override['SYNCER_BACKEND'] = getattr(args, 'backend')
if flags & SyncFlag.RANGE:
if arg.match('range', flags):
args_override['SYNCER_OFFSET'] = getattr(args, 'offset')
args_override['SYNCER_LIMIT'] = getattr(args, 'until')
config.dict_override(args_override, 'local cli args')
if flags & SyncFlag.HEAD:
if arg.match('head', flags):
config.add(getattr(args, 'keep_alive'), '_KEEP_ALIVE')
config.add(getattr(args, 'head'), '_HEAD')