@@ -19,7 +19,7 @@ def build_cli_app() -> Group:
1919 from click import IntRange , group , option
2020 from litestar .cli ._utils import LitestarGroup , console
2121
22- @group (cls = LitestarGroup , name = "workers" )
22+ @group (cls = LitestarGroup , name = "workers" , no_args_is_help = True )
2323 def background_worker_group () -> None :
2424 """Manage background task workers."""
2525
@@ -66,6 +66,26 @@ def run_worker(
6666 for worker_instance in plugin .get_workers ():
6767 loop .run_until_complete (worker_instance .stop ())
6868
69+ @background_worker_group .command (
70+ name = "status" ,
71+ help = "Check the status of currently configured workers and queues." ,
72+ )
73+ @option ("-v" , "--verbose" , help = "Enable verbose logging." , is_flag = True , default = None , type = bool , required = False )
74+ @option ("-d" , "--debug" , help = "Enable debugging." , is_flag = True , default = None , type = bool , required = False )
75+ def worker_status (
76+ app : Litestar ,
77+ verbose : bool | None ,
78+ debug : bool | None ,
79+ ) -> None :
80+ """Run the API server."""
81+ console .rule ("[yellow]Checking SAQ worker status[/]" , align = "left" )
82+ if app .logging_config is not None :
83+ app .logging_config .configure ()
84+ if debug is not None or verbose is not None :
85+ app .debug = True
86+ plugin = get_saq_plugin (app )
87+ show_saq_info (app , 1 , plugin )
88+
6989 return background_worker_group
7090
7191
0 commit comments