From da0e06a97e4cf219586c073529840685cfb4aa80 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sun, 15 Feb 2026 13:48:01 +0100 Subject: [PATCH] chore: prepare for PR --- app/Traits/SshRetryable.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/app/Traits/SshRetryable.php b/app/Traits/SshRetryable.php index a26481056..4366558ef 100644 --- a/app/Traits/SshRetryable.php +++ b/app/Traits/SshRetryable.php @@ -145,24 +145,21 @@ protected function trackSshRetryEvent(int $attempt, int $maxRetries, int $delay, } try { - app('sentry')->captureMessage( - 'SSH connection retry triggered', - \Sentry\Severity::warning(), - [ - 'extra' => [ - 'attempt' => $attempt, - 'max_retries' => $maxRetries, - 'delay_seconds' => $delay, - 'error_message' => $errorMessage, - 'context' => $context, - 'retryable_error' => true, - ], - 'tags' => [ - 'component' => 'ssh_retry', - 'error_type' => 'connection_retry', - ], - ] - ); + \Sentry\withScope(function (\Sentry\State\Scope $scope) use ($attempt, $maxRetries, $delay, $errorMessage, $context): void { + $scope->setExtras([ + 'attempt' => $attempt, + 'max_retries' => $maxRetries, + 'delay_seconds' => $delay, + 'error_message' => $errorMessage, + 'context' => $context, + 'retryable_error' => true, + ]); + $scope->setTags([ + 'component' => 'ssh_retry', + 'error_type' => 'connection_retry', + ]); + \Sentry\captureMessage('SSH connection retry triggered', \Sentry\Severity::warning()); + }); } catch (\Throwable $e) { // Don't let Sentry tracking errors break the SSH retry flow Log::warning('Failed to track SSH retry event in Sentry', [