Skip to content

Commit 1d6a764

Browse files
committed
[FrameworkBundle] Don’t collect CLI profiles if the profiler is disabled
1 parent 756df2a commit 1d6a764

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

EventListener/ConsoleProfilerListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ public function profile(ConsoleTerminateEvent $event): void
109109
return;
110110
}
111111

112+
if (!$this->profiler->isEnabled()) {
113+
return;
114+
}
115+
112116
if (null !== $sectionId = $request->attributes->get('_stopwatch_token')) {
113117
// we must close the section before saving the profile to allow late collect
114118
try {

0 commit comments

Comments
 (0)