mirror of
https://github.com/discourse/discourse.git
synced 2025-03-30 22:29:44 +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?
|
if Sidekiq.paused?
|
||||||
worker.class.perform_in(@delay, *msg['args'])
|
worker.class.perform_in(@delay, *msg['args'])
|
||||||
else
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user