get_config refactor

Nelson Torres 2025-01-30 02:35:43 +00:00
parent 31af1197ac
commit 1697ece9eb
1 changed files with 12 additions and 11 deletions

View File

@ -234,17 +234,18 @@ def get_config() -> dict[str, Any]:
) )
conf_option = section.get('option', {}) conf_option = section.get('option', {})
section = {} # clear the dict to reuse it
section['deribit'] = {}
section['deribit']['key_id'] = conf_option.get('api_key')
section['deribit']['key_secret'] = conf_option.get('api_secret')
section['log'] = {} return {
section['log']['filename'] = 'feedhandler.log' 'deribit': {
section['log']['level'] = 'DEBUG' 'key_id': conf_option.get('api_key'),
section['log']['disabled'] = True 'key_secret': conf_option.get('api_secret'),
},
return section 'log': {
'filename': 'feedhandler.log',
'level': 'DEBUG',
'disabled': True,
}
}
def check_if_complete( def check_if_complete(
oi: dict[str, dict[str, Decimal | None]], oi: dict[str, dict[str, Decimal | None]],
@ -926,7 +927,7 @@ async def maybe_open_oi_feed(
kwargs={ kwargs={
'instruments': instruments 'instruments': instruments
}, },
key=f'{instruments[0]}', key=f'{instruments[0].base}',
) as (cache_hit, feed): ) as (cache_hit, feed):
if cache_hit: if cache_hit: