Skip to content

Commit 0233d9e

Browse files
committed
Fix event loop crash
1 parent bb2903d commit 0233d9e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Components/ServerlessFramework.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,14 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
7373
if ($newLogs === '') {
7474
return;
7575
}
76-
$brefCloud->pushDeploymentLogs($deploymentId, $newLogs);
77-
$newLogs = '';
76+
try {
77+
$brefCloud->pushDeploymentLogs($deploymentId, $newLogs);
78+
79+
$newLogs = '';
80+
} catch (\Throwable $e) {
81+
// Log pushing is best-effort, this is to avoid crashing the event loop
82+
IO::verbose('Failed to push deployment logs: ' . $e->getMessage());
83+
}
7884
});
7985
$exitCode = $process->join();
8086
EventLoop::cancel($logPusherTimer);

0 commit comments

Comments
 (0)