How are results and caches cleaned up over time to...
# pacc-june-20-21-2024
a
How are results and caches cleaned up over time to prevent unnecessary storage consumption?
j
Results persisted to your storage aren’t deleted by Prefect, but folks sometimes run a script to cleanup. I’ll see if I can find an example.
a
Awesome! That's what I was wondering, if folks generally create a flow dedicated to cleanup for things like this.
j
Modified my response - we don’t store the results in the DB, if they are persisted, they are persisted locally by default or wherever you set up for them to be stored. Not finding a script, but I thought there was one in Slack. Will check more in a bit.
You can just use the Pathlib library to delete the results files, something like this - and put it in a flow if you like.