File tree 3 files changed +22
-17
lines changed
3 files changed +22
-17
lines changed Original file line number Diff line number Diff line change @@ -100,24 +100,22 @@ def work(
100
100
):
101
101
"""Prompt to start Celery workers on local machine"""
102
102
103
- print ("\n " )
104
- console .rule (f"[green bold]Start workers[/] :construction_worker:" , align = "left" )
105
- print ("\n " )
106
-
107
- # Print worker queue
108
-
109
- ver_colour = "green" if settings ["version_info" ]["is_latest" ] else "yellow"
110
- print (
111
- f"[cyan]Consuming from queue: [/][{ ver_colour } ]'{ settings ['version_info' ]['commit_short_sha' ]} '[/]"
112
- )
113
-
114
103
if not workers_to_launch :
115
104
workers_to_launch = 0
116
105
106
+ print ("\n " )
107
+
117
108
if workers_to_launch > 0 :
118
- print (f"[green]Starting workers! :construction_worker:[/]" )
109
+ console .rule (
110
+ f"[green bold]Starting workers![/] :construction_worker:" , align = "left"
111
+ )
119
112
else :
120
- print (f"[cyan]Starting worker launcher prompt :construction_worker:[/]" )
113
+ console .rule (
114
+ f"[green bold]Starting worker launcher prompt[/] :construction_worker:" ,
115
+ align = "left" ,
116
+ )
117
+
118
+ print ("\n " )
121
119
122
120
from ..worker import launch_workers
123
121
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ def get_new_console():
171
171
)
172
172
173
173
174
- def launch_workers (workers_to_launch : int ):
174
+ def launch_workers (workers_to_launch : int , queue_name : str ):
175
175
176
176
# Start launching
177
177
@@ -186,17 +186,24 @@ def main(workers: int = 0):
186
186
os_ = platform .system ()
187
187
cpu_cores = multiprocessing .cpu_count ()
188
188
189
+ queue_name = get_queue ()
190
+ if not queue_name :
191
+ raise TypeError ("Couldn't get queue!" )
192
+
193
+ print ()
194
+ logger .info (f"[cyan]Consuming from queue: '{ queue_name } '\n " )
195
+
189
196
# Don't bother with tips if not prompting
190
197
if workers :
191
198
192
- launch_workers (workers )
199
+ launch_workers (workers , queue_name )
193
200
194
201
else :
195
202
196
203
print (f"[green]Running on { os_ } with { cpu_cores } cores.[/]\n " )
197
204
print ("For maximum performance, start as many workers as CPU cores." )
198
205
print ("Default recommendation is 2 cores spare for Resolve and other tasks.\n " )
199
- launch_workers (prompt_worker_amount (cpu_cores ))
206
+ launch_workers (prompt_worker_amount (cpu_cores ), queue_name )
200
207
201
208
print (f"[green]Done![/]" )
202
209
core .app_exit (0 , 5 )
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def get_queue():
51
51
52
52
logger .warning (
53
53
"[yellow]Version constrain is disabled!\n "
54
- + "You [bold]must[/] ensure routing and version compatability yourself!"
54
+ "You [bold]must[/] ensure routing and version compatability yourself!"
55
55
)
56
56
57
57
return "celery"
You can’t perform that action at this time.
0 commit comments