-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implement ActiveSupport notifications #33
Comments
I think ActiveSupport notification is a good idea, but we may need to consider to it is running inside the Rake task. The notification may not be correctly subscribed. I think we can add ActiveJob support as a scheduler job. |
Should not be a problem running in a rake task, it is already in the Rails env. I think just adding |
Let's add this feature before the next release. |
Or is there any alternative way of handling it? The goal here is to be able to handle renewal failures. One option is to just copy the rake task and modify it to handle failures. Another option is for |
We need some refactoring for it. However in the first phase to make it available, I plan to put some hook when For example: def renew
ActiveSupport::Notifications.instrument('letsencrypt.renew', domain: domain) do
verify && issue
end
end ActiveSupport::Notifications.subscribe('letsencrypt.renew') do |*args|
# filter by args.payload[:exception]
end |
Is there a recommend way of getting notified of failed renewals? I see that https://github.com/elct9620/rails-letsencrypt/blob/master/lib/tasks/letsencrypt_tasks.rake#L15 just puts out "Could not renew domain". What do you think of implementing ActiveSupport notifications here? Then a developer could subscribe to the event and handle this case (for example alert the admin or remove the domain). Or any alternative way to listen to such events?
The text was updated successfully, but these errors were encountered: