Skip to content

Commit

Permalink
feat: add retry strategy (#23)
Browse files Browse the repository at this point in the history
Signed-off-by: enesbrsk <[email protected]>
  • Loading branch information
enesbrsk authored Oct 22, 2024
1 parent 1cea7d1 commit e7b88f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions couchbase/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (s *client) CreateMultiPath(ctx context.Context,
Deadline: deadline,
ScopeName: scopeName,
CollectionName: collectionName,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}

if cas != nil {
Expand Down Expand Up @@ -177,6 +178,7 @@ func (s *client) CreatePath(ctx context.Context,
Deadline: deadline,
ScopeName: scopeName,
CollectionName: collectionName,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}

if cas != nil {
Expand Down Expand Up @@ -217,6 +219,7 @@ func (s *client) ArrayAppend(ctx context.Context,
Deadline: deadline,
ScopeName: scopeName,
CollectionName: collectionName,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}

if cas != nil {
Expand Down Expand Up @@ -250,6 +253,7 @@ func (s *client) Increment(ctx context.Context,
ScopeName: scopeName,
Deadline: deadline,
PreserveExpiry: preserveExpiry,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}

if cas != nil {
Expand Down Expand Up @@ -279,6 +283,7 @@ func (s *client) CreateDocument(ctx context.Context,
Expiry: expiry,
ScopeName: scopeName,
CollectionName: collectionName,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}, cb)

return err
Expand All @@ -298,6 +303,7 @@ func (s *client) DeleteDocument(ctx context.Context,
Deadline: deadline,
ScopeName: scopeName,
CollectionName: collectionName,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}

if cas != nil {
Expand Down Expand Up @@ -334,6 +340,7 @@ func (s *client) DeletePath(ctx context.Context,
Deadline: deadline,
ScopeName: scopeName,
CollectionName: collectionName,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}

if cas != nil {
Expand Down
1 change: 1 addition & 0 deletions couchbase/target_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (s *targetClient) Get(ctx context.Context,
Deadline: deadline,
ScopeName: s.scopeName,
CollectionName: s.collectionName,
RetryStrategy: gocbcore.NewBestEffortRetryStrategy(nil),
}, func(result *gocbcore.GetResult, err error) {
if result == nil || err != nil {
cb(nil, err)
Expand Down

0 comments on commit e7b88f9

Please sign in to comment.