From 4480065340c4638a9d57ce057a48a5f422192966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20G=C3=A4hwiler?= Date: Fri, 14 Sep 2018 12:01:05 +0200 Subject: [PATCH] reduced default reconnect delay --- client/service.go | 4 ++-- client/service_test.go | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/service.go b/client/service.go index a48dd5e..02960d5 100644 --- a/client/service.go +++ b/client/service.go @@ -137,8 +137,8 @@ func NewService(queueSize ...int) *Service { return &Service{ state: serviceStopped, Session: session.NewMemorySession(), - MinReconnectDelay: 1 * time.Second, - MaxReconnectDelay: 32 * time.Second, + MinReconnectDelay: 50 * time.Millisecond, + MaxReconnectDelay: 10 * time.Second, ConnectTimeout: 5 * time.Second, DisconnectTimeout: 10 * time.Second, ResubscribeTimeout: 5 * time.Second, diff --git a/client/service_test.go b/client/service_test.go index 6873070..597b19c 100644 --- a/client/service_test.go +++ b/client/service_test.go @@ -235,7 +235,6 @@ func TestServiceReconnect(t *testing.T) { offline := make(chan struct{}) s := NewService() - s.MinReconnectDelay = 50 * time.Millisecond s.ConnectTimeout = 50 * time.Millisecond i := 0 @@ -364,7 +363,6 @@ func TestServiceResubscribe(t *testing.T) { offline := make(chan struct{}) s := NewService() - s.MinReconnectDelay = 50 * time.Millisecond i := 0 @@ -448,7 +446,6 @@ func TestServiceResubscribeTimeout(t *testing.T) { offline := make(chan struct{}) s := NewService() - s.MinReconnectDelay = 50 * time.Millisecond s.ResubscribeTimeout = 50 * time.Millisecond i := 0