selfprivacy-rest-api/selfprivacy_api/utils/huey.py

15 lines
281 B
Python
Raw Normal View History

2022-08-02 22:50:16 +03:00
"""MiniHuey singleton."""
2022-08-20 21:47:32 +03:00
import os
2022-08-11 02:36:36 +03:00
from huey import SqliteHuey
2022-08-02 22:50:16 +03:00
2022-08-11 02:36:36 +03:00
HUEY_DATABASE = "/etc/nixos/userdata/tasks.db"
# Singleton instance containing the huey database.
2022-08-20 21:47:32 +03:00
test_mode = os.environ.get("TEST_MODE")
huey = SqliteHuey(
HUEY_DATABASE,
immediate=test_mode == "true",
)