Skip to content

Commit

Permalink
Use the new deployment removal API (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliV authored and leo committed Nov 6, 2017
1 parent 35eeeba commit 66e70c8
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/providers/sh/util/index.js
Expand Up @@ -823,20 +823,19 @@ module.exports = class Now extends EventEmitter {
}

async remove(deploymentId, { hard }) {
const data = { deploymentId, hard }
const url =`/now/deployments/${deploymentId}?hard=${hard ? '1' : '0' }`

await this.retry(async bail => {
if (this._debug) {
console.time('> [debug] /remove')
console.time(`> [debug] DELETE ${url}`)
}

const res = await this._fetch('/now/remove', {
method: 'DELETE',
body: data
const res = await this._fetch(url, {
method: 'DELETE'
})

if (this._debug) {
console.timeEnd('> [debug] /remove')
console.timeEnd(`> [debug] DELETE ${url}`)
}

// No retry on 4xx
Expand Down

0 comments on commit 66e70c8

Please sign in to comment.