Coverage for seedboxsync/core/dao/taskstatus.py: 100%
7 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"""Peewee DAO model for TaskStatus."""
9from peewee import BooleanField, CharField, DateTimeField
10from seedboxsync.core.dao import SeedboxSyncModel
13class TaskStatus(SeedboxSyncModel):
14 """
15 Represents a taskstatus record in the system to prevent concurrent processes.
17 Attributes:
18 key (str): Unique identifier for the task, e.g., 'sync_blackhole'.
19 running (bool): Indicates whether the task is currently running.
20 started (datetime): Timestamp when the task execution started.
21 finished (datetime): Timestamp when the task execution finished.
22 """
24 key = CharField(primary_key=True, help_text="Unique task identifier")
25 running = BooleanField(default=False, help_text="Whether the task is currently running")
26 started = DateTimeField(null=True, help_text="Timestamp when the task execution started")
27 finished = DateTimeField(null=True, help_text="Timestamp when the task execution finished")