-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(scheduler): add the module of scheduler #1959
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
base: feat/sheduler
Are you sure you want to change the base?
Conversation
修复了初始化 bug 添加了 jobsMap 缓存 修复了拼写错误 扩展了 SafeMap 缩小公开的方法和结构体
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if !ok { | ||
| continue | ||
| } | ||
| labels[key] = value |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The labels should use the unescaped key and value strings. Currently, splitEscapedTag returns the escaped strings directly, but they should be unescaped before storing in the labels map to maintain consistency with how labels are escaped when converting to tags.
| afterCreated, err := s.NewJob( | ||
| ctx, | ||
| "test-job", | ||
| // runs every 5 seconds, but is disabled |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment states 'runs every 5 seconds' but the code uses fastInterval which is 50 milliseconds according to the constant definition.
| // runs every 5 seconds, but is disabled | |
| // runs frequently (fastInterval: 50ms), but is disabled |
| afterCreated, err := s.NewJob( | ||
| ctx, | ||
| "test-job", | ||
| // runs every 5 second, but is disabled |
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'second' to 'seconds' for grammatical consistency.
| // runs every 5 second, but is disabled | |
| // runs every 5 seconds, but is disabled |
Description / 描述
这是任务调度器的核心能力封装,基于 github.com/go-co-op/gocron/v2
Motivation and Context / 背景
目前部分需求依赖定时任务的机制,让服务能定时处理某些事项。
Closes #XXXX
Relates to #XXXX
How Has This Been Tested? / 测试
Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。