You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add some custom metrics using the perform_job.good_job notification, but I'm finding that it's not obvious how to distinguish between successful completions and discards, and I wonder if this is an oversight?
As a work-around you can instead check that handled_error (and unhandled_error?) are nil (which is what the following code in fact does) but this is not super intuitive.
Calling the helper methods on payload[:job] or payload[:execution] doesn't help either, since the fields haven't been updated yet.
Have you a recommendation?
The text was updated successfully, but these errors were encountered:
I'm trying to add some custom metrics using the
perform_job.good_job
notification, but I'm finding that it's not obvious how to distinguish between successful completions and discards, and I wonder if this is an oversight?The code in question is this:
good_job/app/models/good_job/job.rb
Lines 628 to 653 in b557525
Specifically the issue is here (annotated
##
):due to the logic here,
error_event
ends up:discarded
even if there was no error, and this is what ends up onpayload[:error_event]
:As a work-around you can instead check that
handled_error
(andunhandled_error
?) arenil
(which is what the following code in fact does) but this is not super intuitive.Calling the helper methods on
payload[:job]
orpayload[:execution]
doesn't help either, since the fields haven't been updated yet.Have you a recommendation?
The text was updated successfully, but these errors were encountered: