add level 4

This commit is contained in:
Матвей
2026-10-26 10:29:54 +03:00
parent df15ab0967
commit ff33b8a7c2
9 changed files with 265 additions and 40 deletions
+24
View File
@@ -0,0 +1,24 @@
"""Operator-only safe replay for a failed attachment job."""
import argparse
import asyncio
from uuid import UUID
from .config import load_settings
from .storage.postgres import PostgresStore
async def run(attachment_id: UUID) -> None:
store = PostgresStore(load_settings().database_url)
await store.connect()
try:
if not await store.replay_failed_attachment(attachment_id):
raise SystemExit("attachment is not in failed state")
finally:
await store.close()
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("attachment_id", type=UUID)
args = parser.parse_args()
asyncio.run(run(args.attachment_id))