mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 23:41:28 +00:00
17 lines
420 B
Python
17 lines
420 B
Python
"""MiniHuey singleton."""
|
|
from huey import SqliteHuey
|
|
|
|
HUEY_DATABASE = "/etc/nixos/userdata/tasks.db"
|
|
|
|
# Singleton instance containing the huey database.
|
|
class Huey:
|
|
"""Huey singleton."""
|
|
|
|
__instance = None
|
|
|
|
def __new__(cls):
|
|
"""Create a new instance of the huey singleton."""
|
|
if Huey.__instance is None:
|
|
Huey.__instance = SqliteHuey(HUEY_DATABASE)
|
|
return Huey.__instance
|