fix(fulfillment): 主动补全有效 CK 商品能力缓存
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
"""raise account sync queue throughput for capability backfill
|
||||
|
||||
Revision ID: 20261128_0138
|
||||
Revises: 20261128_0137
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
revision: str = "20261128_0138"
|
||||
down_revision: str | None = "20261128_0137"
|
||||
branch_labels: str | None = None
|
||||
depends_on: str | None = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Set the default sync batch to 40 without overriding custom values."""
|
||||
if not sa.inspect(op.get_bind()).has_table("automation_jobs"):
|
||||
return
|
||||
op.execute(
|
||||
sa.text(
|
||||
"""
|
||||
UPDATE automation_jobs
|
||||
SET batch_size = 40,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE `key` = 'account_sync_queue'
|
||||
AND batch_size = 20
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Do not reduce throughput when older code is rolled back."""
|
||||
return
|
||||
Reference in New Issue
Block a user