Skip to content

Commit cd0203f

Browse files
Don't enable tracing unless the profiler is enabled
1 parent f0a7889 commit cd0203f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Debug/TraceableWorkflow.php

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class TraceableWorkflow implements WorkflowInterface
3030
public function __construct(
3131
private readonly WorkflowInterface $workflow,
3232
private readonly Stopwatch $stopwatch,
33+
protected readonly ?\Closure $disabled = null,
3334
) {
3435
}
3536

@@ -90,6 +91,9 @@ public function getCalls(): array
9091

9192
private function callInner(string $method, array $args): mixed
9293
{
94+
if ($this->disabled?->__invoke()) {
95+
return $this->workflow->{$method}(...$args);
96+
}
9397
$sMethod = $this->workflow::class.'::'.$method;
9498
$this->stopwatch->start($sMethod, 'workflow');
9599

DependencyInjection/WorkflowDebugPass.php

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public function process(ContainerBuilder $container): void
3131
->setArguments([
3232
new Reference("debug.{$id}.inner"),
3333
new Reference('debug.stopwatch'),
34+
new Reference('profiler.is_disabled_state_checker', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE),
3435
]);
3536
}
3637
}

0 commit comments

Comments
 (0)