yeq6x commited on
Commit
f7c22cc
·
1 Parent(s): c6e4f56

get_active_task_orderをprocessingを省く

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -216,7 +216,8 @@ def task_status(task_id):
216
  return jsonify({'error': 'Task not found'}), 404
217
 
218
  def get_active_task_order(task_id):
219
- return list(active_tasks.keys()).index(task_id) if task_id in active_tasks else None
 
220
 
221
  # get_task_orderイベントハンドラー
222
  @app.route('/get_task_order/<task_id>', methods=['GET'])
 
216
  return jsonify({'error': 'Task not found'}), 404
217
 
218
  def get_active_task_order(task_id):
219
+ non_processing_tasks = [tid for tid, task in active_tasks.items() if not task.is_processing]
220
+ return non_processing_tasks.index(task_id) if task_id in non_processing_tasks else None
221
 
222
  # get_task_orderイベントハンドラー
223
  @app.route('/get_task_order/<task_id>', methods=['GET'])