Task for continuously check for iTunes Library updates
This commit is contained in:
+8
-2
@@ -1,6 +1,9 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego/toolbox"
|
||||
"github.com/deluan/gosonic/scanner"
|
||||
)
|
||||
@@ -14,6 +17,9 @@ func init() {
|
||||
})
|
||||
|
||||
toolbox.AddTask(TaskItunesScan, scan)
|
||||
toolbox.StartTask()
|
||||
defer toolbox.DeleteTask(TaskItunesScan)
|
||||
go func() {
|
||||
time.Sleep(20 * time.Second)
|
||||
beego.Debug("Starting", TaskItunesScan)
|
||||
toolbox.StartTask()
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user