Use datetime.utcnow() instead of datetime.now()
(suggested in @spulec review)
This commit is contained in:
parent
5f0684fca5
commit
6b581edb55
@ -25,7 +25,7 @@ class ActivityTask(object):
|
|||||||
self.workflow_execution = workflow_execution
|
self.workflow_execution = workflow_execution
|
||||||
# this is *not* necessarily coherent with workflow execution history,
|
# this is *not* necessarily coherent with workflow execution history,
|
||||||
# but that shouldn't be a problem for tests
|
# but that shouldn't be a problem for tests
|
||||||
self.scheduled_at = datetime.now()
|
self.scheduled_at = datetime.utcnow()
|
||||||
|
|
||||||
def _check_workflow_execution_open(self):
|
def _check_workflow_execution_open(self):
|
||||||
if not self.workflow_execution.open:
|
if not self.workflow_execution.open:
|
||||||
|
@ -21,7 +21,7 @@ class DecisionTask(object):
|
|||||||
self.state = "SCHEDULED"
|
self.state = "SCHEDULED"
|
||||||
# this is *not* necessarily coherent with workflow execution history,
|
# this is *not* necessarily coherent with workflow execution history,
|
||||||
# but that shouldn't be a problem for tests
|
# but that shouldn't be a problem for tests
|
||||||
self.scheduled_at = datetime.now()
|
self.scheduled_at = datetime.utcnow()
|
||||||
self.timeout_type = None
|
self.timeout_type = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -6,4 +6,4 @@ def decapitalize(key):
|
|||||||
return key[0].lower() + key[1:]
|
return key[0].lower() + key[1:]
|
||||||
|
|
||||||
def now_timestamp():
|
def now_timestamp():
|
||||||
return float(mktime(datetime.now().timetuple()))
|
return float(mktime(datetime.utcnow().timetuple()))
|
||||||
|
Loading…
Reference in New Issue
Block a user