-
Notifications
You must be signed in to change notification settings - Fork 24
utils: Cancel the conversion tasks if the are older then 24 hours #146
utils: Cancel the conversion tasks if the are older then 24 hours #146
Conversation
@sinnykumari @dustymabe Please review |
fedimg/utils.py
Outdated
task.split()[5], | ||
'%Y-%m-%dT%H:%M:%Sz' | ||
) | ||
import_vol_task_id = task.split[3] |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
Signed-off-by: Sayan Chowdhury <[email protected]>
4c694bf
to
d0b9c65
Compare
I'll let @sinnykumari cast my vote in the review :) |
LGTM |
Signed-off-by: Sayan Chowdhury [email protected]