fix: 改进候选随机性与并发配额稳定性

This commit is contained in:
root
2026-09-15 15:14:01 +08:00
parent 69fc8d51ce
commit 0c5cbd75d9
5 changed files with 384 additions and 69 deletions
@@ -9,8 +9,11 @@ WITH expired AS (
RETURNING "bottle_id"
)
UPDATE "bottles" b
SET "pool_status" = 'IN_POOL', "version" = b."version" + 1
SET "pool_status" = 'IN_POOL',
"active_lease_id" = NULL,
"version" = b."version" + 1
WHERE b."pool_status" = 'LEASED'
AND b."active_lease_id" IS NULL
AND b."id" IN (SELECT "bottle_id" FROM expired);
UPDATE "bottle_pick_leases"
SET "lease_token_ciphertext" = decode(repeat('00', 48), 'hex')