-
Notifications
You must be signed in to change notification settings - Fork 2.2k
sync cache when delete trader #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync cache when delete trader #720
Conversation
🤖 Advisory Check ResultsThese are advisory checks to help improve code quality. They won't block your PR from being merged. 📋 PR InformationTitle Format: Recommended formatValid types: Examples:
PR Size: 🟢 Small (15 lines: +15 -0) 🔧 Backend ChecksGo Formatting: ✅ Good Fix locally: go fmt ./... # Format code
go vet ./... # Check for issues
go test ./... # Run tests⚛️ Frontend ChecksBuild & Type Check: ✅ Success Fix locally: cd web
npm run build # Test build (includes type checking)📖 ResourcesQuestions? Feel free to ask in the comments! 🙏 These checks are advisory and won't block your PR from being merged. This comment is automatically generated from pr-checks-run.yml. |
|
Not just remove from the memory, but also clean the trader gorouting |
代码审查报告 - PR #720审查结果:
|
|
pls fix according to the review suggestions. Thanks |
Pull Request - Backend | 后端 PR
📝 Description | 描述
English: Ensure deleting a trader also drops the in-memory instance and resets the competition cache so stale standings don’t linger after removal.
中文: 删除交易员时同步移除内存中的交易员并清空竞赛缓存,避免删除后仍展示过期的竞赛数据。
🎯 Type of Change | 变更类型
🔗 Related Issues | 相关 Issue
📋 Changes Made | 具体变更
English: | 中文:
api/server.go: 调用TraderManager.RemoveTrader,无论交易员是否仍在内存中都尝试清理,并确保删除操作也刷新竞赛缓存。manager/trader_manager.go: 新增RemoveTrader方法,安全地移除指定交易员并重置competitionCache的数据与时间戳,杜绝后续请求命中旧缓存。🧪 Testing | 测试
Test Environment | 测试环境
Manual Testing | 手动测试
Test Results | 测试结果
🔒 Security Considerations | 安全考虑
⚡ Performance Impact | 性能影响
If impacted, explain | 如果受影响,请说明:
N/A
✅ Checklist | 检查清单
Code Quality | 代码质量
go build)go fmt| 已运行go fmtDocumentation | 文档
Git
devbranch | 已 rebase 到最新dev分支📚 Additional Notes | 补充说明
English: The cache reset is intentionally broad to guarantee no dangling competition data; follow-ups can refine scope if perf impact surfaces.
中文: 为确保不再有残留竞赛数据,此次清缓存采用全量重置;若后续发现性能需求,可再细化清理策略。
By submitting this PR, I confirm | 提交此 PR,我确认:
🌟 Thank you for your contribution! | 感谢你的贡献!