Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Feature: Improve retries mechanism #13

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

DimaZhukovsky
Copy link
Contributor

@DimaZhukovsky DimaZhukovsky commented Sep 11, 2024

Description

swell-node-http has a retry mechanism, but it works even when swell-api returned 500 or 404 status. To improve it we can add checking response status code and retry it only in case of ECONNREFUSED and ECONNABORTED statuses.

image

image

Demo

Simulating situation when 20% of requests are failing with closing connection:

retry-demo-20-fails.mov

src/client.ts Outdated Show resolved Hide resolved
@swellmike
Copy link
Contributor

Plz fix existing tests and add unit test to cover the retry conditions

@DimaZhukovsky DimaZhukovsky merged commit 03960ac into master Sep 12, 2024
1 check passed
@DimaZhukovsky DimaZhukovsky deleted the feat/improve-retries-mechanism branch September 12, 2024 18:24
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.

2 participants