Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CosmosRetryPolicy ¶
type CosmosRetryPolicy struct { MaxRetryCount int FixedBackOffTimeMs int GrowingBackOffTimeMs int // contains filtered or unexported fields }
CosmosRetryPolicy implements gcql.RetryPolicy. Retires only if query attempts are less than or equal to max retry config or max retry config is set to -1 (infinite retries). For RequestErrReadTimeout, RequestErrUnavailable, RequestErrWriteTimeout the request is retried immediately. For rate limited (429) errors, retries are eexecuted after waiting for a duration of RetryAfterMs. If not available, time between retries is increased as per GrowingBackOffTimeMs. If MaxRetryCount is -1 (inifinite) then retry back-off is as per FixedBackOffTimeMs
func NewCosmosRetryPolicy ¶
func NewCosmosRetryPolicy(maxRetryCount int) *CosmosRetryPolicy
NewCosmosRetryPolicy returns a CosmosRetryPolicy with default values for growing and fixed back-off time (in ms)
func (*CosmosRetryPolicy) Attempt ¶
func (crp *CosmosRetryPolicy) Attempt(rq gocql.RetryableQuery) bool
Attempt decides whether to retry or not. Retries only if query attempts are less than or equal to max retry config or max retry config is set to -1 (infinite retries)
func (*CosmosRetryPolicy) GetRetryType ¶
func (crp *CosmosRetryPolicy) GetRetryType(err error) gocql.RetryType
GetRetryType determines the RetryType. In case of rate limiting (429), it parses the error message to get RetryAfterMs