Skip to content
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

Ensure done jobs get deleted periodically #289

Merged
merged 7 commits into from
Mar 8, 2024

Conversation

Hamishpk
Copy link
Contributor

@Hamishpk Hamishpk commented Mar 7, 2024

Done jobs aren't being deleted so they must have streams hanging around on the jobs. I'm removing the logic that updates the last update time when streaming events and made a change to shouldDelete jobs.

The new logic:

A job without listeners will get deleted if it is done and time since last update > retention time or if it's not done and time since last update > expriy time.

A job with listeners will get delete if it is done and time sice last update is > resumption time.

Any job that hasn't had an update in 2x expiry will be deleted.

I've also ensured j.Done is set to false when we create a new execution and added warnings around deleting jobs with listeners.

@Hamishpk Hamishpk changed the title Don't set lastUpdate when streaming events Ensure done jobs get deleted periodically Mar 8, 2024
@Hamishpk Hamishpk merged commit f4c5b3d into thought-machine:master Mar 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants