Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

utils: Cancel the conversion tasks if the are older then 24 hours #146

Merged

Conversation

sayanchowdhury
Copy link
Contributor

Signed-off-by: Sayan Chowdhury [email protected]

@sayanchowdhury
Copy link
Contributor Author

@sinnykumari @dustymabe Please review

fedimg/utils.py Outdated
task.split()[5],
'%Y-%m-%dT%H:%M:%Sz'
)
import_vol_task_id = task.split[3]
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like parenthesis is missing for split() call?

fedimg/utils.py Outdated
)
import_vol_task_id = task.split[3]

start_datetime = expiration_datetime - datetime.timedelta(days=3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any specific reason to pick timedelta value as 3 days?
I am looking at some of the stale task of fedimg and it says expiration date as 2018-07-16 . If we consider timedelta as 3 days, then start_datetime of the task appears to be 2018-07-13 which is not really practical as today's date is 2018-07-11.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes it's very odd the API I think reports the time in which the task will be cleaned up maybe ? It is some future time. we need to find out what the time is set to and relate it back to the current time (i.e. create a task and immediately view the date returned from the API (should be something like X days in the future or something like that) and then figure out the time the task was created by subtracting X from the date reported from the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I was testing, I tested using a stale data which I had saved. This is a fault on my side, this should have been 7 days as @davdunc had confirmed.

@sinnykumari
Copy link
Contributor

sinnykumari commented Jul 11, 2018

Just to confirm, canceling stale conversion task will run when fedimg upload gets triggered for a new compose, correct?

@dustymabe
Copy link
Contributor

Just to confirm, canceling stale conversion task will run when fedimg upload gets triggered for a new compose, correct?

yes that is what should happen.

@sayanchowdhury sayanchowdhury force-pushed the cancel-tasks-automatic branch from 4c694bf to d0b9c65 Compare July 11, 2018 13:43
@dustymabe
Copy link
Contributor

I'll let @sinnykumari cast my vote in the review :)

@sinnykumari
Copy link
Contributor

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants