Выполнить лабораторную 4: S3-вложения и согласованность хранилищ

This commit is contained in:
wpyatzy
2026-11-06 19:53:58 +03:00
parent ec540a1a72
commit d228560474
77 changed files with 15769 additions and 63 deletions
+25
View File
@@ -0,0 +1,25 @@
"""Automatic, bounded-memory sweeps; errors never imply that objects are absent."""
import json
from pathlib import Path
import sys
import time
import signal
import threading
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
from app import store, object_store
from reconcile import reconcile
stop=threading.Event()
signal.signal(signal.SIGTERM,lambda *_: stop.set())
signal.signal(signal.SIGINT,lambda *_: stop.set())
store.pool.open(wait=True,timeout=30)
try:
while not stop.is_set():
try:
print(json.dumps(reconcile(object_store,apply=True,grace_seconds=300)),flush=True)
except Exception as exc:
print(json.dumps({'status':'retry_next_sweep','error_type':type(exc).__name__}),flush=True)
stop.wait(60)
finally:
store.pool.close()
object_store.close()