mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:44:49 +08:00
FEATURE: raise an event when a sidekiq job runs
This commit is contained in:
parent
55d096ee8b
commit
361fbfa518
|
@ -76,7 +76,11 @@ class Sidekiq::Pausable
|
|||
if Sidekiq.paused?
|
||||
worker.class.perform_in(@delay, *msg['args'])
|
||||
else
|
||||
yield
|
||||
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||
result = yield
|
||||
duration = Process.clock_gettime(Process::CLOCK_MONOTONIC) - start
|
||||
DiscourseEvent.trigger(:sidekiq_job_ran, worker, msg, queue, duration)
|
||||
result
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user