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

GoodJob.restart should not start capsules (job execution) when in a webserver but not in async mode #1055

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

bensheldon
Copy link
Owner

Fixes #1054

This isn't my favorite, but the docs have been telling people forever to use this pattern and there isn't a simple way to fix #1054 while also not requiring everyone to change their configuration.

# config/puma.rg
before_fork do
  GoodJob.shutdown
end

on_worker_boot do
  GoodJob.restart
end

If this causes problems, I imagine that I'll add something like restart! that will ignore the new check (or introduce a simpler "start", or ensure that "restart" doesn't actually start the capsule if it hadn't previously been running but rather just return it to the same state). But I am not aware of anyone manually creating capsules, so it's likely not used.

@bensheldon bensheldon force-pushed the async_restart branch 3 times, most recently from 8d42279 to 7d7b0ad Compare August 30, 2023 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Bug: calling GoodJob.restart in Puma on_worker_boot starts GoodJob regardless of it being in async mode or not
1 participant