Skip to content

Commit

Permalink
fix: Accept any 2xx http response code as success when sending data. (#…
Browse files Browse the repository at this point in the history
…270)

* Accept any 2xx http response code as success when sending data.

* Update DelayedSendArray.js

Co-authored-by: Alex Lewitt <48691328+alewitt2@users.noreply.github.com>
  • Loading branch information
adamkingit and alewitt2 authored Mar 30, 2021
1 parent 0df8085 commit 9c52bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/razeedash/DelayedSendArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ module.exports = class DelayedSendArray {
retryDelay: options.retryDelay || 3000, // (default) wait for 3s before trying again
retryStrategy: options.retryStrategy || requestretry.RetryStrategies.HTTPOrNetworkError // (default) retry on 5xx or network errors
}).then(function (response) {
if (response.statusCode == 200) {
if (response.statusCode >= 200 && response.statusCode < 300) {
let numSent = Array.isArray(data) ? data.length : 1;
log.info(`${httpMethod} ${numSent} resource(s) to ${url} successful`);
log.info(`${httpMethod} ${numSent} resource(s) to ${url} successful. StatusCode: ${response.statusCode}`);
return response;
} else {
log.error(`${httpMethod} to ${url} failed: ${response.statusCode}`);
Expand Down

0 comments on commit 9c52bd4

Please sign in to comment.