Skip to content

is there any reason for retries not to be configured per request? #315

@renathoaz

Description

@renathoaz

Hi there,
I noticed that retries are configured per client,
is there any reason not to be per request?

Should I always create a new client each time I want to change RetryCount, RetryMaxWaitTime or RetryCondition without affecting one another if it runs concurrently?

For example:

defaultClient := resty.New()


func One() error{
client.
   defaultClient.SetRetryCount(3).SetRetryMaxWaitTime(20 * time.Second)
   defaultClient.R().Post........
}

func Two() error{
client.
   defaultClient.SetRetryCount(5).SetRetryMaxWaitTime(10* time.Second)
   defaultClient.R().Post........
}

in that case I should create a new instance for each function, right ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions