Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed date parsing while fetching entries for task_status #179

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ckanext/xloader/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ def xloader_submit(context, data_dict):
for job in get_queue().get_jobs()
if 'xloader_to_datastore' in str(job) # filter out test_job etc
]
updated = datetime.datetime.strptime(
existing_task['last_updated'], '%Y-%m-%dT%H:%M:%S.%f')
updated = parse_date(existing_task['last_updated'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't isoparse...

Copy link
Contributor Author

@muhammed-ajmal muhammed-ajmal Dec 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, please check the latest commit.

updated = parse_iso_date(existing_task['last_updated'])

time_since_last_updated = datetime.datetime.utcnow() - updated
if (res_id not in queued_res_ids
and time_since_last_updated > assume_task_stillborn_after):
Expand Down