1
0
mirror of https://github.com/stryan/mumble-discord-bridge.git synced 2024-12-28 17:15:40 -05:00

kill bridge only when connected

This commit is contained in:
stryan 2021-02-11 14:37:34 -05:00
parent aac90dd113
commit e85f521cb3

View File

@ -192,13 +192,12 @@ func main() {
signal.Notify(sc, syscall.SIGINT, syscall.SIGTERM, os.Interrupt, os.Kill)
<-sc
// Signal the bridge to exit cleanly
close(Bridge.BridgeDie)
log.Println("OS Signal. Bot shutting down")
// Wait or the bridge to exit cleanly
if Bridge.Connected {
//TODO BridgeDie occasionally panics on send to closed channel
Bridge.BridgeDie <- true
Bridge.WaitExit.Wait()
}
}