1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

main.go: call shClient.IsOpen() and exit early if closed in interrupt handler.

This commit is contained in:
Henrik Hautakoski 2022-02-02 15:14:56 +01:00
parent 54e8bcf17d
commit 107f3c384c

View file

@ -62,6 +62,11 @@ func run() {
case <-interrupt:
log.Println("Interrupt, closing")
if shClient.IsOpen() == false {
log.Println("ship client not connected, exiting...")
return
}
// Cleanly close the connection by sending a close message and then
// waiting (with timeout) for the server to close the connection.
shClient.SendCloseMessage()