1
0

On SIGHUP reload a playlist file.

This commit is contained in:
Alexander Andreev 2023-10-01 06:38:21 +04:00
parent 6ebe24fa5a
commit 9f361be6c4
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -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
} }