Disable SIGUSR1 handler for Windows (not available)

This commit is contained in:
Deluan 2021-04-23 21:22:04 -04:00
parent 1e539f4e54
commit d5c7a81888
2 changed files with 16 additions and 6 deletions

View File

@ -5,10 +5,8 @@ import (
"errors"
"fmt"
"os"
"os/signal"
"strconv"
"sync"
"syscall"
"time"
"github.com/navidrome/navidrome/core"
@ -74,10 +72,6 @@ func New(ds model.DataStore, cacheWarmer core.CacheWarmer, broker events.Broker)
lock: &sync.RWMutex{},
scan: make(chan bool),
}
signals := []os.Signal{
syscall.SIGUSR1,
}
signal.Notify(sigChan, signals...)
s.loadFolders()
return s
}

16
scanner/signaler_unix.go Normal file
View File

@ -0,0 +1,16 @@
// +build !windows !plan9
package scanner
import (
"os"
"os/signal"
"syscall"
)
func init() {
signals := []os.Signal{
syscall.SIGUSR1,
}
signal.Notify(sigChan, signals...)
}