Skip to content

Commit

Permalink
Replace all instances of functools.lru_cache with functools.cache (#710)
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-fernandes authored Nov 14, 2024
1 parent d1b283b commit fff3ea7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/blueapi/service/interface.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(),
Expand All @@ -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:
Expand Down

0 comments on commit fff3ea7

Please sign in to comment.