Task for continuously check for iTunes Library updates

This commit is contained in:
Deluan
2016-03-11 18:37:37 -05:00
parent 71f1fab575
commit 12b0350d3e
4 changed files with 59 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
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)
}