nuno
06/13/2023, 1:44 PM# 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.Deceivious
06/14/2023, 8:52 AMrefresh_cache
invalidated all previous cache and creates new one with new expiration time.nuno
06/14/2023, 10:15 AM