Create huey.py

This commit is contained in:
tcely 2025-05-28 21:13:15 -04:00 committed by GitHub
parent 18e506a703
commit 15d4a8f4e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

19
tubesync/common/huey.py Normal file
View File

@ -0,0 +1,19 @@
def sqlite_tasks(key, /, prefix=None):
name_fmt = 'huey_{}'
if prefix is None:
prefix = ''
if prefix:
name_fmt = f'huey_{prefix}_' + '{}'
name = name_fmt.format(key)
return dict(
huey_class='huey.SqliteHuey',
name=name,
connection=dict(
filename=f'/config/tasks/{name}.db',
fsync=True,
strict_fifo=True,
),
)