mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 19:20:37 +03:00
20 lines
391 B
Go
20 lines
391 B
Go
package tasks
|
|
|
|
import (
|
|
"github.com/astaxie/beego/toolbox"
|
|
"github.com/deluan/gosonic/scanner"
|
|
)
|
|
|
|
const TaskItunesScan = "iTunes Library Scanner"
|
|
|
|
func init() {
|
|
scan := toolbox.NewTask(TaskItunesScan, "0/5 * * * * *", func() error {
|
|
scanner.CheckForUpdates(false)
|
|
return nil
|
|
})
|
|
|
|
toolbox.AddTask(TaskItunesScan, scan)
|
|
toolbox.StartTask()
|
|
defer toolbox.DeleteTask(TaskItunesScan)
|
|
}
|