resque-job-stats icon indicating copy to clipboard operation
resque-job-stats copied to clipboard

Add support for ActiveJob

Open vijaykramesh opened this issue 4 years ago • 4 comments

We were trying to use this gem and realized it was working for normal resque jobs but not for ActiveJob jobs. The main difference seems to be ActiveJob has #perform as an instance method, not a class method - and ActiveJob doesn't support all the magical callbacks based on the method being named something like after_perform_foobar. Both of these issues are alleviated by this PR. My test passes at least, I will update our application locally to pull from my fork to confirm the tracking is doing what we expect and will report back here.

vijaykramesh avatar Apr 09 '20 00:04 vijaykramesh

github is being odd and not showing the rebuild that travis ran: https://travis-ci.org/github/alanpeabody/resque-job-stats/builds/672765041

vijaykramesh avatar Apr 09 '20 00:04 vijaykramesh

Seems like this works for enqueued and performed but not the other statistics? Specifically I think you need to include the around_perform methods as well to get those to work.

baarkerlounger avatar Apr 27 '20 13:04 baarkerlounger

will try to have a look at this PR this weekend

lukeasrodgers avatar May 04 '20 19:05 lukeasrodgers

Hey @lukeasrodgers is it any chance that you'll have a time to take a look at this MR? Or maybe I can help with it?

jeniaefimov avatar Nov 23 '20 10:11 jeniaefimov