1
0

First check if a unix socket used and only then defer a removing of it.

This commit is contained in:
Alexander Andreev 2023-02-07 02:31:30 +04:00
parent 3eb739bc28
commit ca8613745f
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -34,15 +34,10 @@ func main() {
log.Fatalln(err)
}
if typ, addr := config.SplitNetworkAddress(); typ == "unix" {
defer os.Remove(addr)
}
defer func() {
if typ, addr := config.SplitNetworkAddress(); typ == "unix" {
os.Remove(addr)
}
}()
playlistWatcher := radio.NewPlaylistLogWatcher()
if err := playlistWatcher.Watch(config.Icecast.Playlist, config.ListLastNSongs); err != nil {
log.Fatalln(err)