On SIGHUP reload a playlist file.
This commit is contained in:
parent
6ebe24fa5a
commit
9f361be6c4
@ -85,5 +85,15 @@ func main() {
|
|||||||
doneSignal := make(chan os.Signal, 1)
|
doneSignal := make(chan os.Signal, 1)
|
||||||
signal.Notify(doneSignal, os.Interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGSEGV)
|
signal.Notify(doneSignal, os.Interrupt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGSEGV)
|
||||||
|
|
||||||
|
reloadSignal := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(reloadSignal, syscall.SIGHUP)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
<-reloadSignal
|
||||||
|
plylst.Reload()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
<-doneSignal
|
<-doneSignal
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user