Added a handler for SIGHUP signal that is used for playlist reloading.
This commit is contained in:
parent
f8fd13f8ed
commit
8079058b5c
@ -99,6 +99,18 @@ func main() {
|
||||
}
|
||||
}()
|
||||
|
||||
reloadSignal := make(chan os.Signal, 1)
|
||||
signal.Notify(reloadSignal, syscall.SIGHUP)
|
||||
|
||||
go func() {
|
||||
for {
|
||||
<-reloadSignal
|
||||
if err := plylst.Reload(); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
doneSignal := make(chan os.Signal, 1)
|
||||
signal.Notify(doneSignal, os.Interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGABRT, syscall.SIGSEGV)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user