Skip to content

Commit 5ca8048

Browse files
committed
Ensure all job's raw data times are in UTC
1 parent 6135953 commit 5ca8048

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module MissionControl::Jobs::DatesHelper
22
def formatted_time(time)
3-
time.in_time_zone.strftime("%Y-%m-%d %H:%M:%S.%3N")
3+
time.in_time_zone.strftime("%Y-%m-%d %H:%M:%S.%3N %Z")
44
end
55
end

lib/active_job/queue_adapters/resque_ext.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def deserialize_resque_job(resque_job_hash, index)
190190
job.last_execution_error = execution_error_from_resque_job(resque_job_hash)
191191
job.raw_data = resque_job_hash
192192
job.position = jobs_relation.offset_value + index
193-
job.failed_at = resque_job_hash["failed_at"]&.to_datetime
193+
job.failed_at = resque_job_hash["failed_at"]&.to_datetime&.utc
194194
job.status = job.failed_at.present? ? :failed : :pending
195195
end
196196
end
@@ -263,7 +263,7 @@ def resque_requeue_and_discard(job)
263263

264264
def requeue(job)
265265
resque_job = job.raw_data
266-
resque_job["retried_at"] = Time.now.strftime("%Y/%m/%d %H:%M:%S")
266+
resque_job["retried_at"] = Time.now.utc.strftime("%Y/%m/%d %H:%M:%S")
267267

268268
redis.lset(queue_redis_key, job.position, Resque.encode(resque_job))
269269
Resque::Job.create(resque_job["queue"], resque_job["payload"]["class"], *resque_job["payload"]["args"])

0 commit comments

Comments
 (0)