Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d62d94d48c |
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## v1.5.5 - 2026-06-22
|
||||
- **新增**: `Config.SuppressSuccessLog` 字段,设为 true 时调度器跳过 success 日志,由任务函数自行按处理量汇报,避免空轮询日志噪音。
|
||||
|
||||
## v1.5.4 - 2026-06-21
|
||||
- **依赖更新**: 升级依赖 `jsmod` 至 `v1.5.3`,`cast` 至 `v1.5.3`,`rand` 至 `v1.5.3`,`encoding` 至 `v1.5.4`,`shell` 至 `v1.5.3`,`safe` 至 `v1.5.2`,`id` 至 `v1.5.4`,`file` 至 `v1.5.5`,`config` 至 `v1.5.3`,`log` 至 `v1.5.8`。
|
||||
|
||||
|
||||
@ -33,8 +33,9 @@ task.Add("Report", "@every 1m", func(ctx context.Context) error {
|
||||
// ...
|
||||
return nil
|
||||
}, task.Config{
|
||||
Policy: task.PolicySkip, // 如果上次还没跑完,跳过本次
|
||||
Timeout: 5 * time.Second, // 单次执行超时
|
||||
Policy: task.PolicySkip, // 如果上次还没跑完,跳过本次
|
||||
Timeout: 5 * time.Second, // 单次执行超时
|
||||
SuppressSuccessLog: true, // 抑制默认 success 日志,由任务自行汇报
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
8
TEST.md
8
TEST.md
@ -1,7 +1,7 @@
|
||||
# Test Report
|
||||
|
||||
## Environment
|
||||
- **Date**: 2026-06-21
|
||||
- **Date**: 2026-06-22
|
||||
- **Go Version**: go 1.25.0
|
||||
- **OS**: darwin/amd64
|
||||
|
||||
@ -19,9 +19,9 @@
|
||||
## Benchmarks
|
||||
| Benchmark | Iterations | ns/op |
|
||||
|-----------|------------|-------|
|
||||
| BenchmarkTaskRegistration | 4059084 | 294.0 |
|
||||
| BenchmarkTaskExecutionOverhead/Get | 51555876 | 19.81 |
|
||||
| BenchmarkTaskExecutionOverhead/List | 9835569 | 106.5 |
|
||||
| BenchmarkTaskRegistration | 3664093 | 318.1 |
|
||||
| BenchmarkTaskExecutionOverhead/Get | 52381898 | 26.07 |
|
||||
| BenchmarkTaskExecutionOverhead/List | 10123669 | 116.2 |
|
||||
|
||||
## Details
|
||||
|
||||
|
||||
@ -222,7 +222,7 @@ func (s *Scheduler) runTask(name string) {
|
||||
|
||||
if err != nil {
|
||||
log.DefaultLogger.Error("task failed", "name", name, "err", err, "duration", duration.String())
|
||||
} else {
|
||||
} else if !t.Config.SuppressSuccessLog {
|
||||
log.DefaultLogger.Info("task success", "name", name, "duration", duration.String())
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user