1. 增加任务调度器配置文件

2. 创建/更新计划会自动处理触发器
This commit is contained in:
2025-09-17 23:01:15 +08:00
parent f7a5e4737d
commit 810049d62e
7 changed files with 90 additions and 42 deletions

View File

@@ -29,6 +29,9 @@ type Config struct {
// Heartbeat 心跳配置
Heartbeat HeartbeatConfig `yaml:"heartbeat"`
// TaskConfig 任务调度配置
Task TaskConfig `yaml:"task"`
}
// AppConfig 代表应用基础配置
@@ -106,6 +109,12 @@ type HeartbeatConfig struct {
Concurrency int `yaml:"concurrency"`
}
// TaskConfig 代表任务调度配置
type TaskConfig struct {
Interval int `yaml:"interval"`
NumWorkers int `yaml:"num_workers"`
}
// NewConfig 创建并返回一个新的配置实例
func NewConfig() *Config {
// 默认值可以在这里设置,但我们优先使用配置文件中的值