From d5b1789e44484c377f983d5014e461d9a3c6f2e9 Mon Sep 17 00:00:00 2001 From: jenow Date: Wed, 7 Aug 2019 12:15:17 +0200 Subject: [PATCH 1/3] fix memleack on reconnect if the state is different from Offline --- kuzzle/kuzzle.go | 2 +- protocol/websocket/web_socket.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kuzzle/kuzzle.go b/kuzzle/kuzzle.go index 9a4155ae..b417a44f 100644 --- a/kuzzle/kuzzle.go +++ b/kuzzle/kuzzle.go @@ -33,7 +33,7 @@ import ( ) const ( - version = "2.0.0" + version = "2.0.1" MAX_CONNECT_RETRY = 10 ) diff --git a/protocol/websocket/web_socket.go b/protocol/websocket/web_socket.go index 97a158b5..2c195baf 100644 --- a/protocol/websocket/web_socket.go +++ b/protocol/websocket/web_socket.go @@ -94,7 +94,7 @@ func NewWebSocket(host string, options types.Options) *WebSocket { //Connect connects to a kuzzle instance func (ws *WebSocket) Connect() (bool, error) { - if ws.state != state.Offline { + if ws.state != state.Offline && ws.state != state.Disconnected && ws.state != state.Error { return false, nil } From 0faf465f66fdb3b89e35b3d3d21d702757d65a66 Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Wed, 7 Aug 2019 13:39:04 +0200 Subject: [PATCH 2/3] Fix Travis syntax error --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 36be6a3b..62104da2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,11 +6,11 @@ env: jobs: include: - - name: Documentation test - language: go - go: 1.12.x - script: - - docker-compose -f .ci/doc/docker-compose.yml run doc-tests node index + - name: Documentation test + language: go + go: 1.12.x + script: + - docker-compose -f .ci/doc/docker-compose.yml run doc-tests node index # ----------------------------------------------- # Linux amd64 From 403257e016cedf5bb91accfad9a1437340ffb82d Mon Sep 17 00:00:00 2001 From: jenow Date: Wed, 7 Aug 2019 13:49:22 +0200 Subject: [PATCH 3/3] change version in test --- kuzzle/query_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kuzzle/query_test.go b/kuzzle/query_test.go index 2c0b1010..81431e86 100644 --- a/kuzzle/query_test.go +++ b/kuzzle/query_test.go @@ -96,7 +96,7 @@ func TestQueryWithOptions(t *testing.T) { func TestQueryWithVolatile(t *testing.T) { var k *kuzzle.Kuzzle - var volatileData = types.VolatileData(`{"modifiedBy":"awesome me","reason":"it needed to be modified","sdkVersion":"2.0.0"}`) + var volatileData = types.VolatileData(`{"modifiedBy":"awesome me","reason":"it needed to be modified","sdkVersion":"2.0.1"}`) c := &internal.MockedConnection{ MockSend: func(query []byte, options types.QueryOptions) *types.KuzzleResponse {