Skip to content

Commit 10e8a84

Browse files
authored
enabled celery "--quiet" option for flower command (#1299)
1 parent eaebc1c commit 10e8a84

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

flower/command.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
ENV_VAR_PREFIX = 'FLOWER_'
2525

2626

27+
def sigterm_handler(signum, _):
28+
logger.info('%s detected, shutting down', signum)
29+
sys.exit(0)
30+
31+
2732
@click.command(cls=CeleryCommand,
2833
context_settings={
2934
'ignore_unknown_options': True
@@ -43,13 +48,11 @@ def flower(ctx, tornado_argv):
4348
flower_app = Flower(capp=app, options=options, **settings)
4449

4550
atexit.register(flower_app.stop)
51+
signal.signal(signal.SIGTERM, sigterm_handler)
4652

47-
def sig_handler(signalnum, _):
48-
logger.info('%s detected, shutting down', signalnum)
49-
sys.exit(0)
53+
if not ctx.obj.quiet:
54+
print_banner(app, 'ssl_options' in settings)
5055

51-
signal.signal(signal.SIGTERM, sig_handler)
52-
print_banner(app, 'ssl_options' in settings)
5356
try:
5457
flower_app.start()
5558
except (KeyboardInterrupt, SystemExit):

0 commit comments

Comments
 (0)