Repository navigation
限制视频任务轮询重试次数与总时长 - #1408
Merged
Merged
限制视频任务轮询重试次数与总时长#1408
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
视频任务查询持续返回 HTTP 404 等错误时,原实现会一直轮询。现在连续处理失败最多 10 次,失败后从 30 秒逐步退避至 5 分钟,任务自创建起超过 30 分钟后停止自动轮询。
失败计数保存到数据库,正常查询到运行中时清零,服务重启后继续使用已有计数。达到次数或时间限制后,任务转为
unknown,未结算计费保持待核查,并记录provider_poll_exhausted或provider_poll_timeout;供应商明确返回失败时仍正常释放计费。服务关闭导致的取消不增加失败次数。新增迁移
000022_video_poll_retry_limit,同步 schema、sqlc 生成结果和设计说明。上线时需先应用迁移;历史已超时的任务会在后续轮询中停止自动重试。验证已通过:
go test ./internal/videogen/... ./migrations -count=1。go test -race ./internal/videogen/... -count=1。go test ./...。go vet ./...、make sqlc-check和git diff --check。完整数据库集成测试尚未通过:应用层的
TestAuditIntegration、TestBillingIntegration初始化计费时报no rows in result set,TestResourceIntegration缺少MONKEYAI_S3_ENDPOINT。已在未包含本次修改的main(1b70fb15)复现相同失败。