From fff3ea79b542b34156c607518c80f2bad659b526 Mon Sep 17 00:00:00 2001 From: Daniel Fernandes <65790536+dan-fernandes@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:43:46 +0000 Subject: [PATCH] Replace all instances of functools.lru_cache with functools.cache (#710) --- src/blueapi/service/interface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blueapi/service/interface.py b/src/blueapi/service/interface.py index ceb8eb980..f968fd925 100644 --- a/src/blueapi/service/interface.py +++ b/src/blueapi/service/interface.py @@ -1,6 +1,6 @@ import logging from collections.abc import Mapping -from functools import lru_cache +from functools import cache from typing import Any from bluesky_stomp.messaging import StompClient @@ -31,14 +31,14 @@ def set_config(new_config: ApplicationConfig): _CONFIG = new_config -@lru_cache +@cache def context() -> BlueskyContext: ctx = BlueskyContext() ctx.with_config(config().env) return ctx -@lru_cache +@cache def worker() -> TaskWorker: worker = TaskWorker( context(), @@ -48,7 +48,7 @@ def worker() -> TaskWorker: return worker -@lru_cache +@cache def stomp_client() -> StompClient | None: stomp_config = config().stomp if stomp_config is not None: