Remove refresh

This commit is contained in:
Nuno Campos
2025-05-08 16:50:24 -07:00
parent 31b135f75d
commit d5d6fc0fee
3 changed files with 2 additions and 10 deletions
-3
View File
@@ -610,7 +610,6 @@ def prepare_single_task(
args_key.encode() if isinstance(args_key, str) else args_key,
),
cache_policy.ttl,
cache_policy.refresh,
)
else:
cache_key = None
@@ -734,7 +733,6 @@ def prepare_single_task(
args_key.encode() if isinstance(args_key, str) else args_key,
),
cache_policy.ttl,
cache_policy.refresh,
)
else:
cache_key = None
@@ -869,7 +867,6 @@ def prepare_single_task(
else args_key,
),
cache_policy.ttl,
cache_policy.refresh,
)
else:
cache_key = None
+2 -2
View File
@@ -1071,7 +1071,7 @@ class SyncPregelLoop(PregelLoop, AbstractContextManager):
if cached := {
(t.cache_key.ns, t.cache_key.key): t
for t in self.tasks.values()
if t.cache_key and not t.cache_key.refresh and not t.writes
if t.cache_key and not t.writes
}:
for key, values in self.cache.get(tuple(cached)).items():
task = cached[key]
@@ -1260,7 +1260,7 @@ class AsyncPregelLoop(PregelLoop, AbstractAsyncContextManager):
if cached := {
(t.cache_key.ns, t.cache_key.key): t
for t in self.tasks.values()
if t.cache_key and not t.cache_key.refresh and not t.writes
if t.cache_key and not t.writes
}:
for key, values in (await self.cache.aget(tuple(cached))).items():
task = cached[key]
-5
View File
@@ -137,9 +137,6 @@ class CachePolicy(Generic[KeyFuncT]):
ttl: Optional[int] = None
"""Time to live for the cache entry in seconds. If None, the entry never expires."""
refresh: bool = False
"""Whether to force a refresh of the cache entry when it is accessed."""
@dataclasses.dataclass(**_DC_KWARGS)
class Interrupt:
@@ -193,8 +190,6 @@ class CacheKey(NamedTuple):
"""Key for the cache entry."""
ttl: Optional[int]
"""Time to live for the cache entry in seconds."""
refresh: bool
"""Whether to force a refresh of the cache entry when it is accessed."""
@dataclasses.dataclass(**_T_DC_KWARGS)