Coverage for seedboxsync/core/taskmanager/task/task_sync_seedbox.py: 100%
11 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-26 17:46 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-26 17:46 +0000
1#
2# Copyright (C) 2015-2026 Guillaume Kulakowski <guillaume@kulakowski.fr>
3#
4# For the full copyright and license information, please view the LICENSE
5# file that was distributed with this source code.
6#
7"""Define a huey tasks for seedbox synchronization."""
9import os
10from seedboxsync.core import current_app as app
11from seedboxsync.core.sync.services import (
12 SEEDBOX_LOCK_NAME as LOCK_NAME,
13 SEEDBOX_PRIORITY as PRIORITY,
14 seedbox as seedbox_service,
15)
17task_manager = app.task_manager
18ctx = app.app_context()
19minute = os.getenv("SYNC_SEEDBOX_MINUTE", "*/15")
22@task_manager.task(priority=PRIORITY) # type: ignore[untyped-decorator]
23@task_manager.lock_task(LOCK_NAME) # type: ignore[untyped-decorator]
24def sync_seedbox() -> None:
25 """Define a huey task."""
26 with ctx:
27 seedbox_service(False, True, False)