mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-10 12:38:35 +03:00
adds cache for db handling
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
from functools import lru_cache
|
||||
from sqlalchemy import Engine, create_engine, event
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from shared.settings import get_settings
|
||||
from contextlib import contextmanager
|
||||
|
||||
|
||||
@lru_cache
|
||||
def make_engine(database_url: str):
|
||||
engine = create_engine(database_url, connect_args={"check_same_thread": False})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user