Skip to content

Commit

Permalink
enabled celery "--quiet" option for flower command (#1299)
Browse files Browse the repository at this point in the history
  • Loading branch information
onyx-flame committed Jun 24, 2023
1 parent eaebc1c commit 10e8a84
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions flower/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
ENV_VAR_PREFIX = 'FLOWER_'


def sigterm_handler(signum, _):
logger.info('%s detected, shutting down', signum)
sys.exit(0)


@click.command(cls=CeleryCommand,
context_settings={
'ignore_unknown_options': True
Expand All @@ -43,13 +48,11 @@ def flower(ctx, tornado_argv):
flower_app = Flower(capp=app, options=options, **settings)

atexit.register(flower_app.stop)
signal.signal(signal.SIGTERM, sigterm_handler)

def sig_handler(signalnum, _):
logger.info('%s detected, shutting down', signalnum)
sys.exit(0)
if not ctx.obj.quiet:
print_banner(app, 'ssl_options' in settings)

signal.signal(signal.SIGTERM, sig_handler)
print_banner(app, 'ssl_options' in settings)
try:
flower_app.start()
except (KeyboardInterrupt, SystemExit):
Expand Down

0 comments on commit 10e8a84

Please sign in to comment.