Skip to content
This repository was archived by the owner on Jun 5, 2023. It is now read-only.

Commit cdc0a4f

Browse files
author
toby cabot
committed
Write run_at in a resque-compatible format
Resque expects that the run_at value will be an ISO8601 string in UTC. Pyres was writing seconds since the epoch, which caused pyres-web to crash.
1 parent 35f0574 commit cdc0a4f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyres/horde.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def working_on(self, job):
109109
self.logger.debug('marking as working on')
110110
data = {
111111
'queue': job._queue,
112-
'run_at': int(time.mktime(datetime.datetime.now().timetuple())),
112+
'run_at': datetime.datetime.utcnow().isoformat() + "Z",
113113
'payload': job._payload
114114
}
115115
data = json.dumps(data)

pyres/worker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def working_on(self, job):
285285
logger.debug('marking as working on')
286286
data = {
287287
'queue': job._queue,
288-
'run_at': str(int(time.mktime(datetime.datetime.now().timetuple()))),
288+
'run_at': datetime.datetime.utcnow().isoformat() + "Z",
289289
'payload': job._payload
290290
}
291291
data = json.dumps(data)

0 commit comments

Comments
 (0)