fix: 修复订单 claim 机制状态冲突与 stuck 订单恢复 #2

Open
shanshanzhong147 wants to merge 1 commits from agent/agent/0d59f653 into main
Owner

变更说明

变更说明
shanshanzhong147 added 1 commit 2026-05-25 02:45:43 -04:00
fix: 修复订单 claim 机制状态冲突与 stuck 订单恢复
Build docker and publish / build (20.15.1) (pull_request) Failing after 8m15s
af22430101
- 将 OrderStatusClaimed 从 4 改为 6,与 OrderStatusFailed(4) 区分
- releaseClaim 改为返回 error,失败时不再静默吞掉
- claimAndGetOrder 对 status=claimed 返回可重试错误而非静默跳过
- ProcessTask 区分 claimed stuck 错误(触发重试)和其他非 paid 状态(跳过)
- finalizeCouponAndOrder 使用直接 DB 更新 claimed→finished,绕过
  UpdateOrderStatus 的 status<target 守卫(6 > 5 无法通过该条件)
  并显式删除 Redis 缓存避免缓存脏读
- 新增 StuckOrderRecoveryLogic:每 10 分钟扫描超时 claimed 订单,
  重置为 paid 并重新入队激活任务

Co-authored-by: multica-agent <github@multica.ai>
Some checks are pending
Build docker and publish / build (20.15.1) (pull_request) Failing after 8m15s
This pull request has changes conflicting with the target branch.
  • queue/handler/routes.go
  • queue/logic/order/activateOrderLogic.go
  • queue/logic/order/stuckOrderRecoveryLogic.go
  • queue/types/scheduler.go
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin agent/agent/0d59f653:agent/agent/0d59f653
git checkout agent/agent/0d59f653
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HI-VPN/hi-server#2