Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' into bengourley/retry
Browse files Browse the repository at this point in the history
  • Loading branch information
bengourley committed May 14, 2019
2 parents 38dc011 + 3582823 commit cdfab2e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function cleanupTempFiles (options) {
fs.unlinkSync(options.sourceMap)
}
fs.rmdir(options.tempDir, (err) => {
if (err) {
if (err && err.code !== 'ENOTEMPTY') {
reject(err)
} else {
resolve()
Expand Down
4 changes: 2 additions & 2 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const url = require('url')
const once = require('once')
const FormData = require('form-data')

const MAX_ATTEMPTS = 20
const MAX_ATTEMPTS = 5
const RETRY_INTERVAL = parseInt(process.env.BUGSNAG_RETRY_INTERVAL) || 1000
const TIMEOUT = parseInt(process.env.BUGSNAG_TIMEOUT) || 30000

Expand All @@ -18,7 +18,7 @@ module.exports = (endpoint, makePayload, onSuccess, onError) => {
if (err && err.isRetryable !== false && attempts < MAX_ATTEMPTS) return setTimeout(go, RETRY_INTERVAL)
return onError(err)
}
const go = () => { console.log('try'); send(endpoint, makePayload(), onSuccess, maybeRetry) }
const go = () => send(endpoint, makePayload(), onSuccess, maybeRetry)
go()
}

Expand Down
4 changes: 2 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ describe('validateOptions', () => {

describe('prepareRequest', () => {
test('removes options.overwrite when false', () => {
expect(prepareRequest({ overwrite: false }).formData).toEqual({})
expect(prepareRequest({ overwrite: false })).toEqual({})
})
test('does not remove options.overwrite when true', () => {
expect(prepareRequest({ overwrite: true }).formData).toEqual({ overwrite: 'true' })
expect(prepareRequest({ overwrite: true })).toEqual({ overwrite: 'true' })
})
})

0 comments on commit cdfab2e

Please sign in to comment.