Skip to content

Commit

Permalink
Merge pull request #251 from kuzzleio/fix-remove-listener
Browse files Browse the repository at this point in the history
Remove listener when NetworkError is catched
  • Loading branch information
jenow authored Aug 7, 2019
2 parents df484a7 + 529b4a1 commit 90f2ca1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kuzzle/kuzzle.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
)

const (
version = "2.0.1"
version = "2.0.2"
MAX_CONNECT_RETRY = 10
)

Expand Down Expand Up @@ -197,7 +197,7 @@ func (k *Kuzzle) Connect() error {
k.EmitEvent(event.NetworkError, err)
}
}()
k.protocol.AddListener(event.NetworkError, ee)
k.protocol.Once(event.NetworkError, ee)

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion kuzzle/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.1"}`)
var volatileData = types.VolatileData(`{"modifiedBy":"awesome me","reason":"it needed to be modified","sdkVersion":"2.0.2"}`)

c := &internal.MockedConnection{
MockSend: func(query []byte, options types.QueryOptions) *types.KuzzleResponse {
Expand Down

0 comments on commit 90f2ca1

Please sign in to comment.