mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +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:
|
case <-interrupt:
|
||||||
log.Println("Interrupt, closing")
|
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
|
// Cleanly close the connection by sending a close message and then
|
||||||
// waiting (with timeout) for the server to close the connection.
|
// waiting (with timeout) for the server to close the connection.
|
||||||
shClient.SendCloseMessage()
|
shClient.SendCloseMessage()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue