diff --git a/lib/index.js b/lib/index.js index 432d90d..3f9e314 100644 --- a/lib/index.js +++ b/lib/index.js @@ -756,31 +756,34 @@ module.exports = class Now extends EventEmitter { } return body }, - { retries: 5, minTimeout: 30000, maxTimeout: 90000 } + { retries: 3, minTimeout: 30000, maxTimeout: 90000 } ) } deleteCert(domain) { - return this.retry(async (bail, attempt) => { - if (this._debug) { - console.time(`> [debug] /now/certs #${attempt}`) - } + return this.retry( + async (bail, attempt) => { + if (this._debug) { + console.time(`> [debug] /now/certs #${attempt}`) + } - const res = await this._fetch(`/now/certs/${domain}`, { - method: 'DELETE' - }) + const res = await this._fetch(`/now/certs/${domain}`, { + method: 'DELETE' + }) - if (res.status !== 200) { - const err = new Error(res.body.error.message) - err.userError = false + if (res.status !== 200) { + const err = new Error(res.body.error.message) + err.userError = false - if (res.status === 400 || res.status === 404) { - return bail(err) - } + if (res.status === 400 || res.status === 404) { + return bail(err) + } - throw err - } - }) + throw err + } + }, + { retries: 3 } + ) } async remove(deploymentId, { hard }) {