aboutsummaryrefslogtreecommitdiff
path: root/weed/messaging/client/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/messaging/client/client.go')
-rw-r--r--weed/messaging/client/client.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/messaging/client/client.go b/weed/messaging/client/client.go
index 3f6d1ca53..910fd02e9 100644
--- a/weed/messaging/client/client.go
+++ b/weed/messaging/client/client.go
@@ -23,12 +23,12 @@ func NewMessagingClient(bootstrapBrokers []string) (*MessagingClient, error) {
return nil, err
}
+ util.OnInterrupt(func() {
+ grpcConnection.Close()
+ })
+
return &MessagingClient{
bootstrapBrokers: bootstrapBrokers,
grpcConnection: grpcConnection,
}, nil
}
-
-func (mc *MessagingClient) Shutdown() {
- mc.grpcConnection.Close()
-}