add scan interval

This commit is contained in:
sentriz
2019-11-24 01:32:17 +00:00
parent 1bfeb117dc
commit a92074ecb4
6 changed files with 53 additions and 25 deletions

View File

@@ -250,10 +250,7 @@ func (c *Controller) ServeUpdateLastFMAPIKeyDo(r *http.Request) *Response {
func (c *Controller) ServeStartScanDo(r *http.Request) *Response {
defer func() {
go func() {
err := scanner.
New(c.DB, c.MusicPath).
Start()
if err != nil {
if err := c.Scanner.Start(); err != nil {
log.Printf("error while scanning: %v\n", err)
}
}()