We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3da759d commit 637fe0dCopy full SHA for 637fe0d
cads_broker/dispatcher.py
@@ -110,7 +110,7 @@ class Broker:
110
session_maker_read: sa.orm.sessionmaker
111
session_maker_write: sa.orm.sessionmaker
112
wait_time: float = float(os.getenv("BROKER_WAIT_TIME", 2))
113
- cache = cachetools.TTLCache(
+ ttl_cache = cachetools.TTLCache(
114
maxsize=1024, ttl=int(os.getenv("SYNC_DATABASE_CACHE_TIME", 10))
115
)
116
@@ -158,9 +158,7 @@ def number_of_workers(self):
158
self.environment.number_of_workers = number_of_workers
159
return number_of_workers
160
161
- @cachetools.cachedmethod( # type: ignore
162
- cache=cache,
163
- )
+ @cachetools.cachedmethod(lambda self: self.ttl_cache)
164
def sync_database(self, session: sa.orm.Session) -> None:
165
"""Sync the database with the current status of the dask tasks.
166
0 commit comments