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

Jobs run twice to measure duration for duration and history modules #39

Open
jeniaefimov opened this issue Nov 23, 2020 · 0 comments
Open

Comments

@jeniaefimov
Copy link

In modules Resque::Plugins::JobStats::Duration and Resque::Plugins::JobStats::History I see two different callbacks that start from around_perform_? From what I understand it means that job run twice to measure the time, is it intentional behaviour?

I'm trying to make this gem work with ActiveJob and this is how I can make around_perform_ callbacks work

         base.around_perform do |job, block|
            job.class.methods.select do |meth|
              meth.to_s.start_with?("around_perform_")
            end.each do |meth|
              job.class.send(meth) { block.call }
            end
          end

but in this case if we have more than 1 callback we call job few times. Could we discuss it?

@jeniaefimov jeniaefimov changed the title Tasks run twice to measure duration for duration and history modules Jobs run twice to measure duration for duration and history modules Nov 24, 2020
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

No branches or pull requests

1 participant