Skip to content

Commit

Permalink
Do not retry on reads, and only retry on resource conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Jan 29, 2024
1 parent 798736f commit 157bab3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions settings/generic_setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func retryOnEtagError[Req, Resp any](f func(req Req) (Resp, error), firstReq Req
}

func isEtagVersionError(err error) bool {
return errors.Is(err, databricks.ErrResourceConflict) || errors.Is(err, databricks.ErrNotFound)
return errors.Is(err, databricks.ErrResourceConflict)
}

func getEtagFromError(err error) (string, error) {
Expand Down Expand Up @@ -217,7 +217,7 @@ func makeSettingResource[T, U any](defn genericSettingDefinition[T, U]) *schema.
if err != nil {
return err
}
res, err = retryOnEtagError(func(etag string) (*T, error) { return defn.Read(ctx, w, etag) }, d.Id(), func(req *string, newEtag string) { *req = newEtag })
res, err = defn.Read(ctx, w, d.Id())
if err != nil {
return err
}
Expand Down

0 comments on commit 157bab3

Please sign in to comment.