Browse Source

index: timers

master
Guillermo Rauch 9 years ago
parent
commit
d7f76226c5
  1. 5
      lib/index.js

5
lib/index.js

@ -53,6 +53,7 @@ export default class Now extends EventEmitter {
this._files = hashes;
const deployment = await retry(async (bail) => {
if (this._debug) console.time('> [debug] /create');
const res = await this._fetch('/create', {
method: 'POST',
body: {
@ -66,6 +67,7 @@ export default class Now extends EventEmitter {
})
}
});
if (this._debug) console.timeEnd('> [debug] /create');
// no retry on 403
if (403 === res.status) {
@ -93,6 +95,8 @@ export default class Now extends EventEmitter {
Promise.all(this._missing.map((sha) => retry(async (bail) => {
const file = this._files.get(sha);
const { data, name } = file;
if (this._debug) console.time(`> [debug] /sync ${name}`);
const res = await this._fetch('/sync', {
method: 'POST',
body: {
@ -102,6 +106,7 @@ export default class Now extends EventEmitter {
deploymentId: this._id
}
});
if (this._debug) console.timeEnd(`> [debug] /sync ${name}`);
// no retry on 403
if (403 === res.status) {

Loading…
Cancel
Save