Really clean up after deleting tasks and run the vacuum command #150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I just noticed that my DB just went up in size even tho i regularly cleaned up the old tasks. Turns out i need an additional command when creating the DB but in general both SQLite and Postgres have kinda the same problem.
So i enhanced the prune_db_task_results command and my DB went from 8GB down to 160MB while deleting about 17M old tasks and the freeing up the space of probably some millions more that were deleted before that.
Yes, i know, im probably a heavy user of tasks and the problem will not be as bad for others that fast, but it will build up eventually so i made this general fix.