DEV: Add 'starting' event to sidekiq log when interval logging enabled

This commit is contained in:
David Taylor 2019-03-08 10:56:36 +00:00
parent 3474701146
commit 0a4562253e

View File

@ -30,7 +30,12 @@ module Jobs
@data["job_type"] = job_class.try(:scheduled?) ? "scheduled" : "regular" # Job Type - either s for scheduled or r for regular
@data["opts"] = opts.to_json # Params - json encoded params for the job
@data["status"] = 'pending'
if ENV["DISCOURSE_LOG_SIDEKIQ_INTERVAL"]
@data["status"] = "starting"
write_to_log
end
@data["status"] = "pending"
@start_timestamp = Process.clock_gettime(Process::CLOCK_MONOTONIC)
self.class.ensure_interval_logging!