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

Worker process should also be waited #374

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions invenio_cli/commands/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2022 Graz University of Technology.
# Copyright (C) 2024 University Politehnica of Bucharest
#
# Invenio-Cli is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -178,3 +179,7 @@ def signal_handler(sig, frame):

click.secho(f"Instance running!\nVisit https://{host}:{port}", fg="green")
server.wait()
click.secho("Server execution ended.", fg="red")
if services:
worker.wait()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be:

Suggested change
worker.wait()
worker.terminate()

instead? At this point, the worker process should be killed since the server has ended (we reached this code). The signal.SIGINT handling above would have addressed the interrupt case.

click.secho("Worker execution ended.", fg="red")