First check if a unix socket used and only then defer a removing of it.
This commit is contained in:
parent
3eb739bc28
commit
ca8613745f
@ -34,15 +34,10 @@ func main() {
|
|||||||
log.Fatalln(err)
|
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()
|
playlistWatcher := radio.NewPlaylistLogWatcher()
|
||||||
if err := playlistWatcher.Watch(config.Icecast.Playlist, config.ListLastNSongs); err != nil {
|
if err := playlistWatcher.Watch(config.Icecast.Playlist, config.ListLastNSongs); err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user