fixed some errors with archive handling
This commit is contained in:
+23
@@ -1434,6 +1434,29 @@ def clear_completed_tasks():
|
||||
return jsonify({'ok': False, 'error': str(e)}), 500
|
||||
|
||||
|
||||
@main.route('/api/import/clear-queue', methods=['POST'])
|
||||
def clear_import_queue():
|
||||
"""
|
||||
Clear pending and queued import tasks from the queue.
|
||||
This stops tasks that haven't started processing yet.
|
||||
"""
|
||||
try:
|
||||
# Find and delete pending/queued tasks
|
||||
deleted = ImportTask.query.filter(
|
||||
ImportTask.status.in_(['pending', 'queued'])
|
||||
).delete(synchronize_session=False)
|
||||
|
||||
db.session.commit()
|
||||
|
||||
return jsonify({
|
||||
'ok': True,
|
||||
'deleted': deleted
|
||||
})
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
return jsonify({'ok': False, 'error': str(e)}), 500
|
||||
|
||||
|
||||
@main.route('/api/import/task-stats')
|
||||
def import_task_stats():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user