-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add task scheduler to backend services (cron jobs) #2147
base: development
Are you sure you want to change the base?
Conversation
I won't work any more on this for now - moving onto MdP work. Everything is in place to continue the work for unlocking inactive users and tasks @Anuj-Gupta4 π Although I would say this is one of the lower priority items on our roadmap, to be addressed by anyone when there is some free time. |
cd27408
to
1275fe4
Compare
1275fe4
to
16b1ad6
Compare
16b1ad6
to
26bb642
Compare
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.
This looks great! I'll make a few minor adjustments to refine it for now and come back to it later.
26bb642
to
37af4d6
Compare
# Task unlocking every 3hrs | ||
echo '* */3 * * * /opt/scheduler/unlock_tasks.py' > ./crontab | ||
|
||
# Task unlocking every Sunday 00:00 |
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.
Oops, this should say 'Check inactive users every Sunday 00:00
try: | ||
async with await AsyncConnection.connect(settings.FMTM_DB_URL) as db: | ||
log.info("Starting processing inactive users") | ||
await process_inactive_users(db) |
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.
This needs to be fixed
try: | ||
async with await AsyncConnection.connect(str(settings.FMTM_DB_URL)) as db: | ||
log.info("Starting processing inactive tasks") | ||
await trigger_unlock_tasks(db) |
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.
This needs to be fixed
What type of PR is this? (check all applicable)
Related Issue
Describe this PR
/src/backend/scheduled/xxx.py
/src/backend/scheduled/xxx.py
too.request: Request
var from logic, as we can't use this on a schedule (instead we need to use a service account OSM token to send emails).Alternative Approaches Considered
command:
section.Review Guide
* * * * *
to run every minute.Checklist before requesting a review
[optional] What gif best describes this PR or how it makes you feel?