v1.0.174: classify_batch сбрасывает статус на pending — работает после удаления файлов

This commit is contained in:
2026-06-24 15:17:45 +04:00
parent 592041ab89
commit e939c320cc
2 changed files with 12 additions and 2 deletions
+4 -2
View File
@@ -55,11 +55,13 @@ def _call_llm_classify(header_text):
def classify_batch(batch_id):
"""
Классифицировать все pending-документы в batch.
Вызывается из эндпоинта POST /api/classify-batch.
Классифицировать все документы в batch.
Сбрасывает статус на 'pending' для всех перед началом.
Параллельно (ThreadPoolExecutor) обрабатывает до MAX_WORKERS документов.
Возвращает {ok, total, done, failed}.
"""
# Сбросить статус — allow re-classify after file changes
db_docs.reset_classify_status(batch_id)
pending = db_docs.list_pending(batch_id)
if not pending:
return {"ok": False, "error": "no pending documents"}