Better alignment for memory
This commit is contained in:
parent
878ce01b29
commit
cb4f10e0b4
@ -17,8 +17,8 @@ type Scheduled struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Task struct {
|
type Task struct {
|
||||||
Interval time.Duration
|
|
||||||
Funcs []func(app *App)
|
Funcs []func(app *App)
|
||||||
|
Interval time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
func RunScheduledTasks(app *App, poolSize int, stop <-chan struct{}) {
|
func RunScheduledTasks(app *App, poolSize int, stop <-chan struct{}) {
|
||||||
@ -27,13 +27,13 @@ func RunScheduledTasks(app *App, poolSize int, stop <-chan struct{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks := []Task{
|
tasks := []Task{
|
||||||
{Interval: time.Second, Funcs: app.ScheduledTasks.EverySecond},
|
{Funcs: app.ScheduledTasks.EverySecond, Interval: time.Second},
|
||||||
{Interval: time.Minute, Funcs: app.ScheduledTasks.EveryMinute},
|
{Funcs: app.ScheduledTasks.EveryMinute, Interval: time.Minute},
|
||||||
{Interval: time.Hour, Funcs: app.ScheduledTasks.EveryHour},
|
{Funcs: app.ScheduledTasks.EveryHour, Interval: time.Hour},
|
||||||
{Interval: 24 * time.Hour, Funcs: app.ScheduledTasks.EveryDay},
|
{Funcs: app.ScheduledTasks.EveryDay, Interval: 24 * time.Hour},
|
||||||
{Interval: 7 * 24 * time.Hour, Funcs: app.ScheduledTasks.EveryWeek},
|
{Funcs: app.ScheduledTasks.EveryWeek, Interval: 7 * 24 * time.Hour},
|
||||||
{Interval: 30 * 24 * time.Hour, Funcs: app.ScheduledTasks.EveryMonth},
|
{Funcs: app.ScheduledTasks.EveryMonth, Interval: 30 * 24 * time.Hour},
|
||||||
{Interval: 365 * 24 * time.Hour, Funcs: app.ScheduledTasks.EveryYear},
|
{Funcs: app.ScheduledTasks.EveryYear, Interval: 365 * 24 * time.Hour},
|
||||||
}
|
}
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
Loading…
Reference in New Issue
Block a user