mirror of https://github.com/rq/rq.git
Fix bug where RQ 0.4 could not unpickle jobs from RQ 0.3.x.
This commit is contained in:
parent
39258e2c15
commit
dfd23d6fb8
|
@ -180,7 +180,11 @@ def utcformat(dt):
|
||||||
|
|
||||||
|
|
||||||
def utcparse(string):
|
def utcparse(string):
|
||||||
return datetime.datetime.strptime(string, "%Y-%m-%dT%H:%M:%SZ")
|
try:
|
||||||
|
return datetime.datetime.strptime(string, '%Y-%m-%dT%H:%M:%SZ')
|
||||||
|
except ValueError:
|
||||||
|
# This catches RQ < 0.4 datetime format
|
||||||
|
return datetime.datetime.strptime(string, '%Y-%m-%dT%H:%M:%S.%f+00:00')
|
||||||
|
|
||||||
|
|
||||||
def first(iterable, default=None, key=None):
|
def first(iterable, default=None, key=None):
|
||||||
|
|
Loading…
Reference in New Issue