Expose the maintenance job's rolling re-validation batch (videos re-checked per run) as an admin control on the Scheduler dashboard, stored in app_state (migration 0018; NULL = the env/config default). The job reads the effective value each run via a state helper, clamped to a sane range. Trilingual.
30 lines
916 B
Python
30 lines
916 B
Python
"""admin override for the maintenance re-validation batch size
|
|
|
|
Revision ID: 0018_maintenance_batch_setting
|
|
Revises: 0017_notifications
|
|
Create Date: 2026-06-18
|
|
|
|
Adds app_state.maintenance_revalidate_batch: an admin-tunable override (from the Scheduler
|
|
dashboard) for how many videos the maintenance job re-validates per run. NULL = use the
|
|
env/config default. Purely additive.
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
revision: str = "0018_maintenance_batch_setting"
|
|
down_revision: Union[str, None] = "0017_notifications"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"app_state",
|
|
sa.Column("maintenance_revalidate_batch", sa.Integer(), nullable=True),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("app_state", "maintenance_revalidate_batch")
|