Repository navigation
Fix task polling result URLs and reset locking - #5975
iranyxiao-lab wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR fixes two issues: subscription reset transactions now use a ChangesSubscription Reset Locking
Video Task Result URL Parsing
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant Poller as UpdateVideoTasks
participant Adaptor as TaskAdaptor
participant Parser as updateVideoSingleTask
participant DB as Task Storage
Poller->>Adaptor: FetchTask(taskID)
Adaptor-->>Poller: HTTP response (TaskDto payload)
Poller->>Parser: parse response body
Parser->>Parser: unmarshal as dto.TaskResponse[dto.TaskDto]
alt Success and ResultURL present
Parser->>Parser: set taskResult.Url = trimmed ResultURL
else Success and ResultURL empty
Parser->>Parser: set taskResult.Url = trimmed FailReason
end
Parser->>DB: save task with PrivateData.ResultURL
Estimated code review effort: 2 (Simple) | ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #5976, which uses a non-codex branch name as requested. |
Important
📝 变更描述 / Description
修复两个异步任务和订阅重置相关问题:
dto.TaskResponse[dto.TaskDto],读取顶层result_url并保存到任务私有结果 URL。这样 New API 作为上游异步任务服务时,成功任务不会因为按model.Task解析而丢失结果地址。lockForUpdate(tx)helper。GORM v2 会忽略旧的Set("gorm:query_option", "FOR UPDATE"),该 helper 能在支持的数据库上生成行锁,并在 SQLite 下保持兼容。补充了一个回归测试,覆盖 New API
TaskDto.result_url轮询结果保存流程。🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
TaskDto.result_url解析,也没有覆盖订阅重置行锁问题。Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
通过:
补充验证:
go test ./model ./service结果:
./model通过;./service中现有的 channel affinity usage cache 用例失败,失败项为TestObserveChannelAffinityUsageCacheByRelayFormat_MixedMode和TestObserveChannelAffinityUsageCacheByRelayFormat_UnsupportedModeKeepsEmpty。这两个失败与本 PR 修改的任务轮询和订阅重置代码无关。Summary by CodeRabbit