Don't expect `conf.toml`'s network section

For testing this is particularly true until we offer a template
with whatever (likely localhost) settings planned to ship.
master
Tyler Goodlet 2023-05-22 11:54:36 -04:00
parent e4e4cacef3
commit 660a94d610
1 changed files with 33 additions and 19 deletions

View File

@ -325,8 +325,19 @@ async def start_backfill(
f'Writing {ln} frame to storage:\n'
f'{start_dt} -> {end_dt}'
)
if mkt.dst.atype != 'crypto':
# for now, our table key schema is not including
# the dst[/src] source asset token.
col_sym_key: str = mkt.get_fqme(
delim_char='',
without_src=True,
)
else:
col_sym_key: str = mkt.get_fqme(delim_char='')
await storage.write_ohlcv(
f'{mkt.fqme}',
col_sym_key,
to_push,
timeframe,
)
@ -632,7 +643,7 @@ async def manage_history(
name, uuid = uid
service = name.rstrip(f'.{mod.name}')
fqme: str = mkt.fqme
fqme: str = mkt.get_fqme(delim_char='')
# (maybe) allocate shm array for this broker/symbol which will
# be used for fast near-term history capture and processing.
@ -701,8 +712,13 @@ async def manage_history(
)
assert open_history_client
conf, path = config.load('conf')
tsdbconf = conf['network'].get('tsdb')
tsdb_is_up: bool = False
try_remote_tsdb: bool = False
conf, path = config.load('conf', touch_if_dne=True)
net = conf.get('network')
if net:
tsdbconf = net.get('tsdb')
# lookup backend tsdb module by name and load any user service
# settings for connecting to the tsdb service.
@ -712,12 +728,10 @@ async def manage_history(
# TODO: import and load storagemod by name
# mod = get_storagemod(tsdb_backend)
from ..service import marketstore
tsdb_is_up: bool = False
try_remote_tsdb: bool = False
if tsdb_host == 'localhost':
log.info('Scanning for existing `{tsbd_backend}`')
tsdb_is_up: bool = await check_for_service(f'{tsdb_backend}d')
else:
try_remote_tsdb: bool = True