Skip to content

Commit

Permalink
[datapusher Dag][s] hardcoded date replace with job last updated date
Browse files Browse the repository at this point in the history
  • Loading branch information
sagargg committed Sep 19, 2021
1 parent 40d5b23 commit 64e5ffa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aircan/dags/datapusher_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def datapusher_jobs_checks():
jobs_dict = get_datapusher_jobs(CKAN_SITE_URL)
for job in jobs_dict:
if job['state'] == 'pending' and job['last_updated']:
time_since_last_updated = datetime.utcnow() - datetime.fromisoformat(job['entity_id'])
time_since_last_updated = datetime.utcnow() - datetime.fromisoformat(job['last_updated'])
# Only submit if it has been pending for the last 5 hours.
if time_since_last_updated > timedelta(hours=5):
logging.info('Resubmitting {0}, was pending from {1} ago.'.format(job['entity_id'], time_since_last_updated))
Expand Down

0 comments on commit 64e5ffa

Please sign in to comment.