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

Use the new Delayed::Job plugin system to register Rollbar plugin #350

Merged
merged 1 commit into from
Dec 9, 2015

Conversation

kroky
Copy link
Contributor

@kroky kroky commented Dec 1, 2015

Problem: previous Rollbar DelayedJob plugin used Worker Lifecycle
directly to register the around hook. DelayedJob now clears and
reinitializes the Lifecycle object upon Worker initializations.
This means that commands like rake jobs:work will first register
Rollbar hook, then initialize Worker which will clear the hook.

Solution: use the new plugins system to allow Worker to setup its
Lifecycle object and register all plugins when it needs to.

Problem: previous Rollbar DelayedJob plugin used Worker Lifecycle
directly to register the around hook. DelayedJob now clears and
reinitializes the Lifecycle object upon Worker initializations.
This means that commands like `rake jobs:work` will first register
Rollbar hook, then initialize Worker which will clear the hook.

Solution: use the new plugins system to allow Worker to setup its
Lifecycle object and register all plugins when it needs to.
@jondeandres
Copy link
Contributor

Hi @kroky,

thanks for this PR. It's a nice change 😄. Do you know for which versions of delayed job this is supported? We'll need to use different approaches for old versions?

Thanks for this!

@kroky
Copy link
Contributor Author

kroky commented Dec 1, 2015

Hi @jondeandres,

I just checked 4.0.0 and 3.0.0 and they both had the Plugins system. Not sure if you support v2 but it seems a complete rewrite from that time and it is back in 2010. It is probably wise to test this change with versions back to 3.0.0.

@jondeandres
Copy link
Contributor

awesome @kroky, we will test and review this and probably merge it if everything is working fine.

thanks a lot for this, again, it's a nice change!

@kroky
Copy link
Contributor Author

kroky commented Dec 1, 2015

👍 thanks! I stumbled upon this today and decided to send you the update as we are using Rollbar with delayed job bg workers and having exceptions reported is important. Thanks for all your work with Rollbar!

@jondeandres
Copy link
Contributor

@kroky from your PR description:

DelayedJob now clears and reinitializes the Lifecycle object upon Worker initializations. This means that commands like rake jobs:work will first register Rollbar hook, then initialize Worker which will clear the hook.

From which version have you detected this?

Thanks

@kroky
Copy link
Contributor Author

kroky commented Dec 1, 2015

Well, I am using v4.1.1 and it fails with the old code. I am not sure when did they introduce the change which is this:
https://github.com/collectiveidea/delayed_job/blob/master/lib/delayed/worker.rb#L136

@jondeandres
Copy link
Contributor

Nice, seems they added that change from 4.1.0.

Thanks!

@jondeandres jondeandres merged commit 24e4022 into rollbar:master Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants