Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Celery's --quiet option for flower command to suppress banner output #1299

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading