Only use cache upon failure and cleanup cache after success #4036
Unanswered
peterroelants
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use Result objects for persisting results of a scheduled flow run while achieving the following three things:
Is this possible?
Some more details:
I have a periodically scheduled flow running with a Docker Agent where a couple of Tasks have retries configured. When I run the healthcheck when creating the Docker storage I see a
UserWarning: Task <Task: RetryTask> has retry settings but some upstream dependencies do not have result types. See https://docs.prefect.io/core/concepts/results.html for more details.
. I tried using Result objects to persist the Task result output. This gets rid of the warning and indeed caches the results to the provided location. However, the results seem to be persisted indefinitely and I want to clean them up when the flow has finished (or after a pre-define amount of time).I tried setting
cache_for
, however, it seems my results stay persisted and nothing gets deleted after thecache_for
period. The only thingcache_for
seems to do is cache results for future runs (a task scheduled in the future is not run when the cache is still valid), which for my use case is undesired behaviour.Beta Was this translation helpful? Give feedback.
All reactions