forked from mtusi2026/mtusi2026lab5
Выполнить лабораторную 5: асинхронный pipeline и исследование идемпотентности
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user