Перенести реализацию мессенджера из lab6 в skeleton lab7.

Контракт, публичные тесты и README задания оставлены от lab7.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-26 19:23:53 +03:00
co-authored by Cursor
parent 20afc2c790
commit 54b4b9e509
61 changed files with 5879 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
"""Operator replay of one failed job. A ready job is left unchanged."""
from __future__ import annotations
import asyncio
import sys
from uuid import UUID
from app import db, jobs
async def _run(job_id: UUID) -> int:
await db.connect()
try:
result = await jobs.replay(job_id)
finally:
await db.close()
print(result["result"])
return 0 if result["result"] in {"noop", "queued"} else 1
def main() -> None:
if len(sys.argv) != 2:
print("usage: python -m app.replay JOB_ID", file=sys.stderr)
raise SystemExit(2)
raise SystemExit(asyncio.run(_run(UUID(sys.argv[1]))))
if __name__ == "__main__":
main()