Skip to content

Commit

Permalink
fix(profile): use context.state
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 9, 2018
1 parent 4f28403 commit 0d92aae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/reporters/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import Profiler from '../profiler';

export default class ProfileReporter {
progress(context) {
if (!context.profiler) {
context.profiler = new Profiler();
if (!context.state.profiler) {
context.state.profiler = new Profiler();
}

context.profiler.onRequest(context.state.request);
context.state.profiler.onRequest(context.state.request);
}

done(context) {
if (context.profiler) {
context.state.profile = context.profiler.getFormattedStats();
delete context.profiler;
if (context.state.profiler) {
context.state.profile = context.state.profiler.getFormattedStats();
delete context.state.profiler;
}
}

Expand Down

0 comments on commit 0d92aae

Please sign in to comment.