Closed Bug 1071249 Opened 10 years ago Closed 10 years ago

Create cron job for expired tasks

Categories

(Mozilla QA Graveyard :: One and Done, defect, P1)

Version 2
x86
macOS
defect

Tracking

(Not tracked)

VERIFIED FIXED
Milestone 2

People

(Reporter: bsilverberg, Unassigned)

Details

We need a cron job to run the expired tasks expiration check, which will automatically close attempts for tasks that have expired.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
This is a separate cron job, which is why I opened a separate bug. There are two tasks to set up two different cron jobs, and one can be done now (this one), and one cannot be done until a bug 1033808 is resolved.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
I went back and looked at the code we currently have, and it does 1 thing:

For any attempts that have been open for more than 30 days, which are for *one-time* tasks, it will close the attempt.

Do we also want a job that will close any open attempts for tasks that have expired (i.e., the task itself has an end date which is now past) for all tasks (whether one-time or repeatable)?

I guess the question is: What should happen if a user has an open attempt and the task itself expires (i.e., its end date is now in the past)? Should that attempt be closed and the user informed, or should it just remain open?
Flags: needinfo?(rbillings)
Yes, we need a job that will close all tasks that have passed their end date & notify the user the next time they log in.
Flags: needinfo?(rbillings)
Commit pushed to master at https://github.com/mozilla/oneanddone

https://github.com/mozilla/oneanddone/commit/c571551df4751e2d9a730d9898fd56ba180fd226
Bug 1071249 - Create cron job for expired tasks

Add routine to close attempts for expired tasks
This has landed and will be pushed to dev and stage later today. We can discuss verification for this tomorrow.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Just let me know when it's up on dev/stage & I'll get on it.
Sorry, Rebecca, this landed on dev and stage some time ago.
I see that tasks past their end date immediately serve the expired/invalid notice- is that from the cron job? How often does it run?
If you update a task and thereby cause it to expire that will automatically close the attempts, so that is likely what you're seeing. Let's talk tomorrow about how to test the background task. FTR, it currently runs every hour, but I think we should reduce that to every 6 hours or so.
Verified on staging, all tasks with expiration date in the past were marked as closed.
Status: RESOLVED → VERIFIED
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in before you can comment on or make changes to this bug.