From 3b533c7d065e66c2ed222d3bb7da935aa180ce8c Mon Sep 17 00:00:00 2001 From: mahansky Date: Wed, 4 Sep 2024 13:57:03 +0200 Subject: [PATCH] fix same commands different batch --- bootstrap/helpers/remoteProcess.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.php index c3f8316e7..cccc41e71 100644 --- a/bootstrap/helpers/remoteProcess.php +++ b/bootstrap/helpers/remoteProcess.php @@ -249,8 +249,11 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d ->reduce(function ($deploymentLogLines, $logItem) use ($seenCommands) { $command = $logItem['command']; $isStderr = $logItem['type'] === 'stderr'; + $isNewCommand = ! is_null($command) && ! $seenCommands->first(function ($seenCommand) use ($logItem) { + return $seenCommand['command'] === $logItem['command'] && $seenCommand['batch'] === $logItem['batch']; + }); - if (! is_null($command) && ! $seenCommands->contains($command)) { + if ($isNewCommand) { $deploymentLogLines->push([ 'line' => $command, 'timestamp' => $logItem['timestamp'], @@ -259,7 +262,10 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d 'command' => true, ]); - $seenCommands->push($command); + $seenCommands->push([ + 'command' => $command, + 'batch' => $logItem['batch'], + ]); } $lines = explode(PHP_EOL, $logItem['output']);