Skip to content

Commit

Permalink
Merge pull request #46 from netlify/update-deps
Browse files Browse the repository at this point in the history
Swap deps
  • Loading branch information
bcomnes authored Jul 30, 2018
2 parents 8be9b89 + a6eb77f commit b9e3ff2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"chalk": "^2.4.1",
"clean-deep": "^3.0.2",
"cli-ux": "^4.7.3",
"configstore": "github:bcomnes/configstore#custom-path",
"configstore": "^3.1.2",
"dot-prop": "^4.2.0",
"find-up": "^3.0.0",
"flush-write-stream": "^1.0.3",
Expand All @@ -54,8 +54,7 @@
"p-all": "^1.0.0",
"p-limit": "^2.0.0",
"p-map": "^1.2.0",
"p-timeout": "^2.0.1",
"p-wait-for": "^1.0.0",
"p-wait-for": "^2.0.0",
"parallel-transform": "^1.1.0",
"prettyjson": "^1.2.1",
"pump": "^3.0.0",
Expand Down
9 changes: 4 additions & 5 deletions src/utils/api/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const pMap = require('p-map')
const fs = require('fs')
const fileHasher = require('./file-hasher')
const pWaitFor = require('p-wait-for')
const pTimeout = require('p-timeout')
const flatten = require('lodash.flatten')

module.exports = async (api, siteId, dir, opts) => {
Expand Down Expand Up @@ -63,11 +62,11 @@ async function uploadFiles(api, deployId, uploadList, opts) {
async function waitForDeploy(api, deployId, timeout) {
let deploy

await pTimeout(
pWaitFor(loadDeploy, 1000), // poll every 1 second
await pWaitFor(loadDeploy, {
interval: 1000,
timeout,
'Timeout while waiting for deploy'
)
message: 'Timeout while waiting for deploy'
})

return deploy

Expand Down
7 changes: 5 additions & 2 deletions src/utils/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const get = require('lodash.get')
const dfn = require('@netlify/open-api')
const { methods, generateMethod } = require('./open-api')
const pWaitFor = require('p-wait-for')
const pTimeout = require('p-timeout')
const deploy = require('./deploy')

class NetlifyAPI {
Expand Down Expand Up @@ -68,7 +67,11 @@ class NetlifyAPI {
return !!t.authorized
}

await pTimeout(pWaitFor(checkTicket, opts.poll), opts.timeout, 'Timeout while waiting for ticket grant')
await pWaitFor(checkTicket, {
interval: opts.poll,
timeout: opts.timeout,
message: 'Timeout while waiting for ticket grant'
})

const accessToken = await api.exchangeTicket({ ticketId: authorizedTicket.id })
this.accessToken = accessToken.access_token
Expand Down

0 comments on commit b9e3ff2

Please sign in to comment.