From cb4f10e0b435da75d13bf8689421e8c8510f04f3 Mon Sep 17 00:00:00 2001 From: Maximilian Date: Tue, 19 Dec 2023 16:41:31 -0600 Subject: [PATCH] Better alignment for memory --- app/schedule.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/schedule.go b/app/schedule.go index 87523f5..56b4b9a 100644 --- a/app/schedule.go +++ b/app/schedule.go @@ -17,8 +17,8 @@ type Scheduled struct { } type Task struct { - Interval time.Duration Funcs []func(app *App) + Interval time.Duration } func RunScheduledTasks(app *App, poolSize int, stop <-chan struct{}) { @@ -27,13 +27,13 @@ func RunScheduledTasks(app *App, poolSize int, stop <-chan struct{}) { } tasks := []Task{ - {Interval: time.Second, Funcs: app.ScheduledTasks.EverySecond}, - {Interval: time.Minute, Funcs: app.ScheduledTasks.EveryMinute}, - {Interval: time.Hour, Funcs: app.ScheduledTasks.EveryHour}, - {Interval: 24 * time.Hour, Funcs: app.ScheduledTasks.EveryDay}, - {Interval: 7 * 24 * time.Hour, Funcs: app.ScheduledTasks.EveryWeek}, - {Interval: 30 * 24 * time.Hour, Funcs: app.ScheduledTasks.EveryMonth}, - {Interval: 365 * 24 * time.Hour, Funcs: app.ScheduledTasks.EveryYear}, + {Funcs: app.ScheduledTasks.EverySecond, Interval: time.Second}, + {Funcs: app.ScheduledTasks.EveryMinute, Interval: time.Minute}, + {Funcs: app.ScheduledTasks.EveryHour, Interval: time.Hour}, + {Funcs: app.ScheduledTasks.EveryDay, Interval: 24 * time.Hour}, + {Funcs: app.ScheduledTasks.EveryWeek, Interval: 7 * 24 * time.Hour}, + {Funcs: app.ScheduledTasks.EveryMonth, Interval: 30 * 24 * time.Hour}, + {Funcs: app.ScheduledTasks.EveryYear, Interval: 365 * 24 * time.Hour}, } var wg sync.WaitGroup