fix same commands different batch

This commit is contained in:
mahansky
2024-09-04 13:57:03 +02:00
parent b0039885eb
commit 3b533c7d06

View File

@@ -249,8 +249,11 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d
->reduce(function ($deploymentLogLines, $logItem) use ($seenCommands) { ->reduce(function ($deploymentLogLines, $logItem) use ($seenCommands) {
$command = $logItem['command']; $command = $logItem['command'];
$isStderr = $logItem['type'] === 'stderr'; $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([ $deploymentLogLines->push([
'line' => $command, 'line' => $command,
'timestamp' => $logItem['timestamp'], 'timestamp' => $logItem['timestamp'],
@@ -259,7 +262,10 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d
'command' => true, 'command' => true,
]); ]);
$seenCommands->push($command); $seenCommands->push([
'command' => $command,
'batch' => $logItem['batch'],
]);
} }
$lines = explode(PHP_EOL, $logItem['output']); $lines = explode(PHP_EOL, $logItem['output']);