-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Automatically unlock tasks that have been locked for more than 3 days #1603
Comments
The logic could be better here:
|
I agree with your idea of checking the last activity but i guess only 3 hours will be less for the users. We can implement the logic if there is room to increase the timeout easily in future. |
@spwoodcock This task seems better suited for cron. Is there an API suitable for triggering this task in the background? |
My original replyA scheduled event does make sense: but it should be sure to only run on active projects, with events perhaps in the last week. There is no API to do this - the code has to be written, so I would suggest the SQL approach, as its as close to the data as possible. Cron on a Linux system is not very portable when it comes to deployment, especially in distributed systems such as Kubernetes. A pg_cron function seems the most versatile and efficient approach to me. Particularly as its guaranteed to only run once, and show have minimal performance overhead. We could also run maintenance tasks like VACUUM. The only hurdle is actually installing pg_cron into the database container, for which I should probably help out: https://www.nico.fyi/blog/dockerfile-for-pgcron-postgres-cron-job My reconsidered replySoftware development comes with trade offs.
So with this in mind, to make our codebase as approachable and understandable by all developers as possible, we can probably just write the script in Python. The docker compose config can have a container for running system cron that I can set up once the script is in place and tested 👍 |
Blocker #1604
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Solution
This is a relatively easy solution via pg_cron directly on the database.
Create a function:
Create the cron (runs every day at midnight):
The text was updated successfully, but these errors were encountered: