Выполнить лабораторную 5: асинхронный pipeline и исследование идемпотентности

This commit is contained in:
wpyatzy
2026-11-20 18:47:23 +03:00
parent 276dbdad8a
commit ec277e7e64
72 changed files with 6521 additions and 27 deletions
+14
View File
@@ -0,0 +1,14 @@
import json
import sys
from pathlib import Path
sys.path.insert(0,str(Path(__file__).resolve().parents[1]))
from app import store
from psycopg.rows import dict_row
store.pool.open(wait=True,timeout=20)
try:
with store.connect() as conn:
rows=conn.cursor(row_factory=dict_row).execute('''SELECT j.id AS job_id,j.state,j.attempt,j.lease_until,
a.pipeline_version,o.published_at,o.deliveries FROM jobs j JOIN attachments a ON a.id=j.attachment_id
JOIN outbox o ON o.job_id=j.id WHERE a.id=%s ORDER BY j.pipeline_version''',(sys.argv[1],)).fetchall()
print(json.dumps(rows,default=str))
finally:store.pool.close()