Skip to content

Commit

Permalink
Add restart option pulpcore-worker
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Nov 8, 2023
1 parent 417a8d1 commit 4bee4b5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/+pulpcore-worker-restart.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added a ``--restart`` option to pulpcore worker. This requires "hupper" to be installed.
10 changes: 9 additions & 1 deletion pulpcore/tasking/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@
@click.option(
"--burst/--no-burst", help="Run in burst mode; terminate when no more tasks are available."
)
@click.option(
"--reload/--no-reload", help="Reload worker on code changes. [requires hupper to be installed."
)
@click.command()
def worker(pid, burst):
def worker(pid, burst, reload):
"""A Pulp worker."""

if reload:
import hupper

hupper.start_reloader(__name__ + ".worker")

if pid:
with open(os.path.expanduser(pid), "w") as fp:
fp.write(str(os.getpid()))
Expand Down

0 comments on commit 4bee4b5

Please sign in to comment.