Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Add optional delay argument#23

Open
Redsandro wants to merge 7 commits into
segmentio:masterfrom
Redsandro:patch-3
Open

Add optional delay argument#23
Redsandro wants to merge 7 commits into
segmentio:masterfrom
Redsandro:patch-3

Conversation

@Redsandro

Copy link
Copy Markdown

Optionally delay retries by the specified amount of milliseconds.

superagent
  .get('https://segment.io')
  .retry(2, 800) // retry twice with 0.8s delay before responding
  .end(onresponse);

Convenient for servers that only err when too busy.

Optionally delay retries by the specified amount of milliseconds.

```javascript
superagent
  .get('https://segment.io')
  .retry(2, 800) // retry twice with 0.8s delay before responding
  .end(onresponse);
```

Convenient for servers that only err when too busy.
@Redsandro

Copy link
Copy Markdown
Author

@calvinfo very bite size PR for your consideration.

@calvinfo

Copy link
Copy Markdown
Contributor

Awesome, looks reasonable to me! Thanks @Redsandro, do you mind adding some tests to this as well?

@Redsandro

Copy link
Copy Markdown
Author

@calvinfo definitely. That should do it. This proves and tests the concept. Recreating previous tests would just yield the same results, but take longer.

@Redsandro

Copy link
Copy Markdown
Author

Hoping to get this published, I've bumped the version if that makes things slightly easier.

@wolfeidau

Copy link
Copy Markdown

I would love to see this get merged!

Do you need anything more?

@vitorebatista

Copy link
Copy Markdown

Please merge it ASAP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants