mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 08:41:04 -04:00
refactor(backend): ♻️ add initial support for global dependency injection
This commit is contained in:
parent
0f6f81eb27
commit
da501adce8
@ -173,3 +173,13 @@ class AppSettings(BaseSettings):
|
||||
|
||||
|
||||
settings = AppSettings()
|
||||
|
||||
|
||||
def get_app_dirs() -> AppDirectories:
|
||||
global app_dirs
|
||||
return app_dirs
|
||||
|
||||
|
||||
def get_settings() -> AppSettings:
|
||||
global settings
|
||||
return settings
|
||||
|
@ -1,3 +1,10 @@
|
||||
from functools import lru_cache
|
||||
|
||||
from .data_access_layer import DatabaseAccessLayer
|
||||
|
||||
db = DatabaseAccessLayer()
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_database():
|
||||
return db
|
||||
|
Loading…
x
Reference in New Issue
Block a user