Skip to content

Commit e536e5a

Browse files
committed
fix(coroutine): remove unnecessary SentrySdk initialization in CoroutineAspect
1 parent 24a3f5c commit e536e5a

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/sentry/src/Tracing/Aspect/CoroutineAspect.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Hyperf\Di\Aop\AbstractAspect;
2020
use Hyperf\Di\Aop\ProceedingJoinPoint;
2121
use Hyperf\Engine\Coroutine as Co;
22-
use Sentry\SentrySdk;
2322
use Sentry\State\Scope;
2423
use Sentry\Tracing\SpanContext;
2524

@@ -66,8 +65,6 @@ function (Scope $scope) use ($proceedingJoinPoint, $callingOnFunction) {
6665

6766
// Transfer the Sentry context to the new coroutine.
6867
$proceedingJoinPoint->arguments['keys']['callable'] = function () use ($callable, $span, $callingOnFunction, $cid) {
69-
SentrySdk::init(); // Ensure Sentry is initialized in the new coroutine.
70-
7168
// Restore the Context in the new Coroutine.
7269
foreach (self::CONTEXT_KEYS as $key) {
7370
Context::getOrSet($key, fn () => Context::get($key, coroutineId: $cid));

0 commit comments

Comments
 (0)