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:
parent
54e8bcf17d
commit
107f3c384c
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue