Skip to content

Commit

Permalink
updating workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
taddyb committed Aug 22, 2024
1 parent 3b43b4f commit 833b0c6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
7 changes: 0 additions & 7 deletions rnr/src/rnr/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
from functools import lru_cache

from src.rnr.app.consumer_manager import ConsumerManager


@lru_cache
def get_consumer_manager():
return ConsumerManager()
4 changes: 2 additions & 2 deletions rnr/src/rnr/app/api/routes/consumer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from fastapi import APIRouter, BackgroundTasks, Depends
from pydantic import BaseModel

from src.rnr.app import get_consumer_manager
from src.rnr.app.cache import get_consumer_manager
from src.rnr.app.consumer_manager import ConsumerManager
from src.rnr.app.core import get_settings
from rnr.src.rnr.app.core.cache import get_settings
from src.rnr.app.core.settings import Settings
from src.rnr.app.schemas import ConsumerStatus

Expand Down
9 changes: 9 additions & 0 deletions rnr/src/rnr/app/cache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Functions that require lru_cache"""
from functools import lru_cache

from src.rnr.app.consumer_manager import ConsumerManager


@lru_cache
def get_consumer_manager():
return ConsumerManager()
15 changes: 0 additions & 15 deletions rnr/src/rnr/app/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
from functools import lru_cache

from src.rnr.app.core.settings import Settings


@lru_cache
def get_settings() -> Settings:
"""Instantiating the Settings object using LRU caching
Returns
-------
Settings
The Settings config object
"""
return Settings()
15 changes: 15 additions & 0 deletions rnr/src/rnr/app/core/cache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from functools import lru_cache

from src.rnr.app.core.settings import Settings


@lru_cache
def get_settings() -> Settings:
"""Instantiating the Settings object using LRU caching
Returns
-------
Settings
The Settings config object
"""
return Settings()

0 comments on commit 833b0c6

Please sign in to comment.