Use datetime.utcnow() instead of datetime.now()

(suggested in @spulec review)
This commit is contained in:
Jean-Baptiste Barth 2015-11-18 22:02:58 +01:00
parent 5f0684fca5
commit 6b581edb55
3 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ class ActivityTask(object):
self.workflow_execution = workflow_execution
# this is *not* necessarily coherent with workflow execution history,
# 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):
if not self.workflow_execution.open:

View File

@ -21,7 +21,7 @@ class DecisionTask(object):
self.state = "SCHEDULED"
# this is *not* necessarily coherent with workflow execution history,
# but that shouldn't be a problem for tests
self.scheduled_at = datetime.now()
self.scheduled_at = datetime.utcnow()
self.timeout_type = None
@property

View File

@ -6,4 +6,4 @@ def decapitalize(key):
return key[0].lower() + key[1:]
def now_timestamp():
return float(mktime(datetime.now().timetuple()))
return float(mktime(datetime.utcnow().timetuple()))