-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Use custom ActiveRecord connection parameters in GoodJob external process #1591
Comments
If these are dynamic values, I think a simple I think that setting statement timeout though is done via Another way to do it would be by having multiple named database configurations. Here's how I do it in one of my apps:
...though you still have to then say "connects_to" in your application if it's in GoodJob. |
Also, I realize now there isn't a documented way to check for this, but if you needed to check if you're in the GoodJob::CLI.within_exe? # => true or nil/false Which gets set here: https://github.com/bensheldon/good_job/blob/fdf9a01fc8c5f93a5394a2a59cc59ba1ab82af03/exe/good_job#L6C1-L6C24 |
Thanks @bensheldon, |
Good question. I should make a PR to delegate that from |
Naming works fine for me. |
Naming is hard 😆 I just opened up this PR for I'll get this released in a bit today. Glad you opened this issue! |
Fantastic thanks! |
Hi there, migrating from Sidekiq, where we would use the
configure_server
block to set a longerstatement_timeout
for all ActiveRecord queries inside the Sidekiq server process (where, in the 'real time' Rails server, we would use a timeout commensurate with the timeout for requests). Is there a way to do something equivalent in GoodJob? It seems likeconfigure_active_record
would only apply to models inheriting fromGoodJob::BaseRecord
, not to all connections.The text was updated successfully, but these errors were encountered: