Skip to content

Commit

Permalink
[#2334] Perform DataPusher timestamp check using UTC
Browse files Browse the repository at this point in the history
Task timestamps are stored in UTC but the check was done against .now(),
causing a test failure locally (Summer saving time)
  • Loading branch information
amercader committed Apr 11, 2017
1 parent 7db1470 commit f5eb025
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/datapusher/logic/action.py
Expand Up @@ -94,7 +94,7 @@ def datapusher_submit(context, data_dict):
if existing_task.get('state') == 'pending':
updated = datetime.datetime.strptime(
existing_task['last_updated'], '%Y-%m-%dT%H:%M:%S.%f')
time_since_last_updated = datetime.datetime.now() - updated
time_since_last_updated = datetime.datetime.utcnow() - updated
if time_since_last_updated > assume_task_stale_after:
# it's been a while since the job was last updated - it's more
# likely something went wrong with it and the state wasn't
Expand Down

0 comments on commit f5eb025

Please sign in to comment.