Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwillchen committed Jun 7, 2017
1 parent 416d4a0 commit 7938b54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion lighthouse-core/config/plots.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"first-meaningful-paint",
"speed-index-metric",
"estimated-input-latency",
"time-to-interactive",
"first-interactive",
"consistently-interactive"
]
Expand Down
18 changes: 14 additions & 4 deletions plots/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function main() {
if (args.reuseChrome) {
ChromeLauncher.launch().then(launcher => {
return runAnalysisWithExistingChromeInstances(launcher)
.catch(err => console.error(err))
.catch(handleError)
.then(() => launcher.kill());
});
return;
Expand Down Expand Up @@ -110,16 +110,26 @@ function runAnalysisWithNewChromeInstances() {
promise = promise.then(() => {
return ChromeLauncher.launch().then(launcher => {
return singleRunAnalysis(url, id, launcher, {ignoreRun})
.catch(err => console.error(err))
.catch(handleError)
.then(() => launcher.kill());
})
.catch(err => console.error(err));
.catch(handleError);
});
}
}
return promise;
}

/**
* @param {!Error} error
*/
function handleError(error) {
console.error(error);
if (process.env.CI) {
process.exit(1);
}
}

/**
* Reuses existing Chrome instance for all site runs.
* Returns a promise chain that analyzes all the sites n times.
Expand Down Expand Up @@ -195,7 +205,7 @@ function analyzeWithLighthouse(launcher, url, outputPath, assetsPath, {ignoreRun
return Printer.write(lighthouseResults, flags.output, outputPath);
});
})
.catch(err => console.error(err));
.catch(handleError);
}

/**
Expand Down

0 comments on commit 7938b54

Please sign in to comment.