From 1fcca8afeb1c9a43452e7efa18e7447c317a840f Mon Sep 17 00:00:00 2001 From: ajiththnn Date: Thu, 25 Jun 2020 16:34:38 +0530 Subject: [PATCH] add max reconnects --- protocols/sub/pubnub.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocols/sub/pubnub.go b/protocols/sub/pubnub.go index 9200afd..fb09a75 100644 --- a/protocols/sub/pubnub.go +++ b/protocols/sub/pubnub.go @@ -264,6 +264,9 @@ func pubnubConnect(cfg pubnubConfig) (jmsg.RawPubnubClient, error) { config := pubnub.NewConfig() config.SubscribeKey = cfg.SubscribeKey config.PublishKey = cfg.PublishKey + config.SubscribeRequestTimeout = 30 + config.MaximumReconnectionRetries = 2 + if cfg.SecretKey != "" { config.SecretKey = cfg.SecretKey }