Skip to content

Conversation

@dezhishen
Copy link
Member

@dezhishen dezhishen commented Jan 11, 2026

Description / 描述

这是任务调度器的核心能力封装,基于 github.com/go-co-op/gocron/v2

Motivation and Context / 背景

目前部分需求依赖定时任务的机制,让服务能定时处理某些事项。

Closes #XXXX

Relates to #XXXX

How Has This Been Tested? / 测试

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code with go fmt or prettier.
    我已使用 go fmtprettier 格式化提交的代码。
  • I have added appropriate labels to this PR (or mentioned needed labels in the description if lacking permissions).
    我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
  • I have requested review from relevant code authors using the "Request review" feature when applicable.
    我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
  • I have updated the repository accordingly (If it’s needed).
    我已相应更新了相关仓库(若适用)。

This comment was marked as outdated.

This comment was marked as outdated.

@dezhishen dezhishen changed the title feat(scheuler): 增加调度器的相关方法 feat(scheuler): add the module of scheduler Jan 11, 2026

This comment was marked as outdated.

This comment was marked as outdated.

@dezhishen dezhishen added the Module: Task Task, scheduling and other goroutine-based features related label Jan 13, 2026

This comment was marked as outdated.

This comment was marked as outdated.

@dezhishen dezhishen changed the title feat(scheuler): add the module of scheduler feat(scheduler): add the module of scheduler Jan 13, 2026
@dezhishen dezhishen requested a review from Copilot January 14, 2026 10:50
Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Jan 14, 2026

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.

Copilot uses AI. Check for mistakes.
afterCreated, err := s.NewJob(
ctx,
"test-job",
// runs every 5 seconds, but is disabled
Copy link

Copilot AI Jan 14, 2026

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.

Suggested change
// runs every 5 seconds, but is disabled
// runs frequently (fastInterval: 50ms), but is disabled

Copilot uses AI. Check for mistakes.
afterCreated, err := s.NewJob(
ctx,
"test-job",
// runs every 5 second, but is disabled
Copy link

Copilot AI Jan 14, 2026

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.

Suggested change
// runs every 5 second, but is disabled
// runs every 5 seconds, but is disabled

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Module: Task Task, scheduling and other goroutine-based features related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant