lab5: async attachment pipeline (RabbitMQ + worker), thumbnail/crop/optimized, outbox relay, lease, idempotent replay (grade 4)

This commit is contained in:
2026-11-03 20:50:30 +03:00
parent 276dbdad8a
commit 15c3697bdc
45 changed files with 4964 additions and 19 deletions
@@ -0,0 +1,34 @@
"""allow processing status in jobs
Revision ID: <hash>
Revises: <id lease_until>
Create Date: <date>
"""
from __future__ import annotations
from alembic import op
revision = "390b34423ded"
down_revision = "6980f998def1"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.execute("""
ALTER TABLE jobs DROP CONSTRAINT IF EXISTS jobs_status_check
""")
op.execute("""
ALTER TABLE jobs
ADD CONSTRAINT jobs_status_check
CHECK (status IN ('pending', 'processing', 'published', 'failed'))
""")
def downgrade() -> None:
op.execute("ALTER TABLE jobs DROP CONSTRAINT IF EXISTS jobs_status_check")
op.execute("""
ALTER TABLE jobs
ADD CONSTRAINT jobs_status_check
CHECK (status IN ('pending', 'published', 'failed'))
""")