diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-04 21:44:59 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-04 21:44:59 +0200 |
| commit | 9b147c4e49b8a6a378da6728cc74d9453ad2501f (patch) | |
| tree | 5b63f2f793b6d1169d920faa244180bb35ac7299 /internal/server/continuous.go | |
| parent | 0bc4eaebd646e9577145be0f09ef09fb77c51f22 (diff) | |
perf: avoid range-value struct copies in server job loops (task 351)
Diffstat (limited to 'internal/server/continuous.go')
| -rw-r--r-- | internal/server/continuous.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/server/continuous.go b/internal/server/continuous.go index 3178240..c714997 100644 --- a/internal/server/continuous.go +++ b/internal/server/continuous.go @@ -28,12 +28,13 @@ func (c *continuous) start(ctx context.Context) { } func (c *continuous) runJobs(ctx context.Context) { - for _, job := range c.cfg.Server.Continuous { + for i := range c.cfg.Server.Continuous { + job := &c.cfg.Server.Continuous[i] if !job.Enable { dlog.Server.Debug(job.Name, "Not running job as not enabled") continue } - go func(job config.Continuous) { + go func(job *config.Continuous) { c.runJob(ctx, job) retryTicker := time.NewTicker(time.Minute) defer retryTicker.Stop() @@ -50,7 +51,7 @@ func (c *continuous) runJobs(ctx context.Context) { } } -func (c *continuous) runJob(ctx context.Context, job config.Continuous) { +func (c *continuous) runJob(ctx context.Context, job *config.Continuous) { dlog.Server.Debug(job.Name, "Processing job") files := fillDates(job.Files) |
