@@ -52,6 +52,22 @@ def _print_highlight(message: str) -> None:
5252 typer .echo (typer .style (message , fg = typer .colors .MAGENTA ))
5353
5454
55+ @main .command ()
56+ def state_list_dirs ():
57+ """Lists files inside state directories"""
58+
59+ async def _async_state_list_dirs () -> None :
60+ app = await _setup_app_for_task_execution ()
61+
62+ mounted_volumes : MountedVolumes = app .state .mounted_volumes
63+
64+ for state_path in mounted_volumes .state_paths :
65+ state_path_content = list (state_path .glob ("*" ))
66+ typer .echo (f"Entries in { state_path } : { state_path_content } " )
67+
68+ asyncio .run (_async_state_list_dirs ())
69+
70+
5571@main .command ()
5672def state_save ():
5773 """Saves the state, usually workspace directory"""
@@ -67,15 +83,15 @@ async def _async_save_state() -> None:
6783 TaskProgress .create (), settings , mounted_volumes , rabbitmq
6884 )
6985
70- asyncio .get_event_loop (). run_until_complete (_async_save_state ())
86+ asyncio .run (_async_save_state ())
7187 _print_highlight ("state save finished successfully" )
7288
7389
7490@main .command ()
7591def outputs_push ():
7692 """Pushes the output ports"""
7793
78- async def _async_save_state () -> None :
94+ async def _async_outputs_push () -> None :
7995 app = await _setup_app_for_task_execution ()
8096
8197 mounted_volumes : MountedVolumes = app .state .mounted_volumes
@@ -85,7 +101,7 @@ async def _async_save_state() -> None:
85101 TaskProgress .create (), None , mounted_volumes , rabbitmq
86102 )
87103
88- asyncio .get_event_loop (). run_until_complete ( _async_save_state ())
104+ asyncio .run ( _async_outputs_push ())
89105 _print_highlight ("output ports push finished successfully" )
90106
91107
0 commit comments