Skip to content

Conversation

@dezhishen
Copy link
Member

@dezhishen dezhishen commented Jan 11, 2026

Description / 描述

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

  1. 将任务参数封装为 JobBuilder,降低 Job定义难度,隐藏 gocron 内部细节,降低业务侧代码与gocron的耦合
  2. scheduler 本身的options 未封装,原因是:scheduler由主干来控制,不涉及到业务侧的使用,暴露原始参数,方便处理
  3. tags []string 处理为 labels map[string]string,方便外部管理,如区分job所属用户

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 marked this pull request as ready for review January 15, 2026 06:08
@dezhishen dezhishen requested a review from KirCute January 15, 2026 09:31

This comment was marked as resolved.

This comment was marked as resolved.

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.

2 participants