v1.0.178: логи + lock-файл + guard от двойного classify. Ответ Опуса: минимум сейчас.

This commit is contained in:
2026-06-25 13:29:06 +04:00
parent aa1b801e94
commit 4e9dd94433
2 changed files with 23 additions and 2 deletions
+5
View File
@@ -25,9 +25,14 @@ if __name__ == "__main__":
sys.exit(1)
batch_id = sys.argv[1]
lock_path = f"/tmp/classify_{batch_id}.lock"
try:
result = classify_batch(batch_id)
print(f"classify_worker DONE: {result}")
except Exception as e:
print(f"classify_worker FAILED: {e}", file=sys.stderr)
sys.exit(1)
finally:
# Убрать lock-файл в любом случае
if os.path.exists(lock_path):
os.remove(lock_path)