Skip to content

Commit

Permalink
Update dependency got to v9 (#10861)
Browse files Browse the repository at this point in the history
no issue 

- The underlying issue is the change in retry behavior in 'got' (sindresorhus/got@a3e77de)
- Now 500 responses trigger 2 default retries
- Renamed retries -> retry. As mentioned in https://github.com/sindresorhus/got/releases/v9.0.0
- Added response body error check
  • Loading branch information
renovate[bot] authored and naz committed Jul 4, 2019
1 parent 683e37c commit 1f32a13
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 127 deletions.
2 changes: 1 addition & 1 deletion core/server/services/webhooks/trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module.exports = (event, model) => {
'Content-Type': 'application/json'
},
timeout: 2 * 1000,
retries: 5
retry: 5
};

common.logging.info(`Trigger Webhook for "${webhook.get('event')}" with url "${url}".`);
Expand Down
5 changes: 4 additions & 1 deletion core/test/unit/lib/request_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,17 @@ describe('Request', function () {

const requestMock = nock('http://nofilehere.com')
.get('/files/test.txt')
.reply(500, {message: 'something aweful happend', code: 'AWFUL_ERROR'});
.times(3) // 1 original request + 2 default retries
.reply(500, {message: 'something awful happened', code: 'AWFUL_ERROR'});

return request(url, options).then(() => {
throw new Error('Request should have errored with an awful error');
}, (err) => {
requestMock.isDone().should.be.true();
should.exist(err);
err.statusMessage.should.be.equal('Internal Server Error');
err.body.should.match(/something awful happened/);
err.body.should.match(/AWFUL_ERROR/);
});
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"ghost-ignition": "3.1.0",
"ghost-storage-base": "0.0.3",
"glob": "7.1.4",
"got": "8.3.2",
"got": "9.6.0",
"gscan": "2.6.2",
"html-to-text": "5.1.1",
"image-size": "0.7.4",
Expand Down
Loading

0 comments on commit 1f32a13

Please sign in to comment.