Task Operations¶
Task management operations.
- async shared.database.operations.task.create_user_task_with_queue(user, description)[source]¶
Create a new user task and add it to the processing queue.
- async shared.database.operations.task.deactivate_user_tasks(user_id)[source]¶
Deactivate all active tasks for a user.
- async shared.database.operations.task.get_most_recent_active_user_task()[source]¶
Return the most recently updated active user task, or None if none exist.
- async shared.database.operations.task.get_user_tasks(user_id)[source]¶
Get all tasks for a user with eager loading to avoid lazy loading issues.
- async shared.database.operations.task.update_user_task_status(task_id, status)[source]¶
Update task status.
- Parameters:
task_id (
int
) – Task IDstatus (
TaskStatus
) – New status
- Return type:
- async shared.database.operations.task.update_user_task_status_for_user(user_id, task_id, status)[source]¶
Safely update task status ensuring ownership by user.
- Parameters:
user_id (
int
) – Internal user IDtask_id (
int
) – Task IDstatus (
TaskStatus
) – New status
- Return type:
- Returns:
True if updated successfully, False if user not found