fix(backend): standardize superset client init and auth
- Update plugins (debug, mapper, search) to explicitly map environment config to SupersetConfig - Add authenticate method to SupersetClient for explicit session management - Add get_environment method to ConfigManager - Fix navbar dropdown hover stability in frontend with invisible bridge
This commit is contained in:
35
backend/delete_running_tasks.py
Normal file
35
backend/delete_running_tasks.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Script to delete tasks with RUNNING status from the database."""
|
||||
|
||||
from sqlalchemy.orm import Session
|
||||
from src.core.database import TasksSessionLocal
|
||||
from src.models.task import TaskRecord
|
||||
|
||||
def delete_running_tasks():
|
||||
"""Delete all tasks with RUNNING status from the database."""
|
||||
session: Session = TasksSessionLocal()
|
||||
try:
|
||||
# Find all task records with RUNNING status
|
||||
running_tasks = session.query(TaskRecord).filter(TaskRecord.status == "RUNNING").all()
|
||||
|
||||
if not running_tasks:
|
||||
print("No RUNNING tasks found.")
|
||||
return
|
||||
|
||||
print(f"Found {len(running_tasks)} RUNNING tasks:")
|
||||
for task in running_tasks:
|
||||
print(f"- Task ID: {task.id}, Type: {task.type}")
|
||||
|
||||
# Delete the found tasks
|
||||
session.query(TaskRecord).filter(TaskRecord.status == "RUNNING").delete(synchronize_session=False)
|
||||
session.commit()
|
||||
|
||||
print(f"Successfully deleted {len(running_tasks)} RUNNING tasks.")
|
||||
except Exception as e:
|
||||
session.rollback()
|
||||
print(f"Error deleting tasks: {e}")
|
||||
finally:
|
||||
session.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
delete_running_tasks()
|
||||
Reference in New Issue
Block a user