diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2023-09-03 00:12:19 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2023-09-10 19:01:00 +0300 |
| commit | 3a4cd4935dafe6d445daac3b7d6ced409f99aa23 (patch) | |
| tree | 751e4ca259f7f35556fdfabc78dfacdedbad9ac5 /app/database.py | |
| parent | c13734f56e9b01a61cfb66019a71d46c3dfe6f86 (diff) | |
Add web server
Diffstat (limited to 'app/database.py')
| -rw-r--r-- | app/database.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/database.py b/app/database.py index fdeac1a..b796dc8 100644 --- a/app/database.py +++ b/app/database.py @@ -3,14 +3,12 @@ from tinydb import TinyDB from app.AggroConfig import AggroConfig -def setup_db(config: AggroConfig): - global database_manager - database_manager = DatabaseManager(config) - - class DatabaseManager: - def __init__(self, config: AggroConfig): + def __init__(self): + self.db: TinyDB | None = None + + def setup(self, config: AggroConfig): self.db = TinyDB(config.db_path) -database_manager: DatabaseManager +database_manager: DatabaseManager = DatabaseManager() |
