12345678910111213141516171819202122232425 |
- package utils
- import (
- "github.com/robfig/cron"
- "server/task"
- )
- func ScheduledTask() {
- c := cron.New()
-
- _ = c.AddFunc("0 */5 * * * ?", func() {
-
- task.GatewayRoutingInspection()
- })
-
- _ = c.AddFunc("0 0 8 * * ? ", func() {
- task.SetBrightnessAtDay()
- })
- _ = c.AddFunc("0 0 18 * * ?", func() {
- task.SetBrightnessAtNight()
- })
- c.Start()
- }
|