Revive `ms-shell` sub-cmd

incr_update_backup
Tyler Goodlet 2022-02-18 12:17:41 -05:00
parent 893ac7a986
commit bbae8ad426
1 changed files with 17 additions and 10 deletions

View File

@ -111,20 +111,27 @@ def ms_stream(config: dict, names: List[str], url: str):
) )
@click.option( @click.option(
'--port', '--port',
default=5995 default=5993
) )
@click.pass_obj @click.pass_obj
def ms_shell(config, tl, host, port): def ms_shell(config, tl, host, port):
"""Start an IPython shell ready to query the local marketstore db. '''
""" Start an IPython shell ready to query the local marketstore db.
async def main():
async with open_marketstore_client(host, port) as client:
query = client.query # noqa
# TODO: write magics to query marketstore
from IPython import embed
embed()
tractor.run(main) '''
from piker.data.marketstore import backfill_history
from piker._daemon import open_piker_runtime
async def main():
async with open_piker_runtime(
'ms_shell',
enable_modules=['piker.data._ahab'],
):
await backfill_history()
# TODO: write magics to query marketstore
# from IPython import embed
# embed()
trio.run(main)
@cli.command() @cli.command()