semantic cleanup

This commit is contained in:
2026-01-23 21:58:32 +03:00
parent 343f2e29f5
commit 4ba28cf93e
26 changed files with 8429 additions and 5628 deletions

View File

@@ -1,10 +1,17 @@
#!/usr/bin/env python3
"""Script to delete tasks with RUNNING status from the database."""
# [DEF:backend.delete_running_tasks:Module]
# @PURPOSE: Script to delete tasks with RUNNING status from the database.
# @LAYER: Utility
# @SEMANTICS: maintenance, database, cleanup
from sqlalchemy.orm import Session
from src.core.database import TasksSessionLocal
from src.models.task import TaskRecord
# [DEF:delete_running_tasks:Function]
# @PURPOSE: Delete all tasks with RUNNING status from the database.
# @PRE: Database is accessible and TaskRecord model is defined.
# @POST: All tasks with status 'RUNNING' are removed from the database.
def delete_running_tasks():
"""Delete all tasks with RUNNING status from the database."""
session: Session = TasksSessionLocal()
@@ -30,6 +37,8 @@ def delete_running_tasks():
print(f"Error deleting tasks: {e}")
finally:
session.close()
# [/DEF:delete_running_tasks:Function]
if __name__ == "__main__":
delete_running_tasks()
# [/DEF:backend.delete_running_tasks:Module]