# 1 - run foo in a flow, result cached for 10s
@task(cache_key_fn=task_input_hash, cache_expiration=pendulum.duration(seconds=10))
def foo():
pass
# 2 - after 10s, run foo in a flow, result cached for 10h
@task(cache_key_fn=task_input_hash, cache_expiration=pendulum.duration(hours=10))
def foo():
pass
# 3 - run foo in a flow, result still cached for 10h (same code and inputs as before)
@task(cache_key_fn=task_input_hash, cache_expiration=pendulum.duration(seconds=10))
def foo():
pass
Any way to change
cache_expiration
?
refresh_cache
only updates the result in cache but does not reset
cache_expiration
.
Reason: have tasks with large cache_expiration (hours/days) but if needed reset the cache (update the result) and restart the expiration from that moment.
d
Deceivious
06/14/2023, 8:52 AM
I assumed that the
refresh_cache
invalidated all previous cache and creates new one with new expiration time.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.