Skip to content

Commit

Permalink
Set command name as "Name" if no "autocreate" is used and no name was…
Browse files Browse the repository at this point in the history
… passed #155
  • Loading branch information
ctippler committed Sep 27, 2022
1 parent 5bce04d commit 55b332d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ExecutionTrait.php
Expand Up @@ -85,6 +85,11 @@ public static function initProcessManager($monitoringId, $options = [])
if ($options['autoCreate'] && !$monitoringItem) {
$options['command'] = self::getCommand($options);

if(!array_key_exists('name',$options)){
$commandParts = explode_and_trim(" ",$options['command']);
$options['name'] = $commandParts[1] ?? '';
}

$monitoringItem = new MonitoringItem();
$monitoringItem->setValues($options);

Expand Down Expand Up @@ -267,7 +272,7 @@ public static function executeChildProcesses(MonitoringItem $monitoringItem,arra
}
$monitoringItem->setCurrentWorkload(0)->setTotalWorkload(count($workload))->setMessage('Starting child processes')->save();

$i = 0;
$i = 0;
foreach($workloadChunks as $i => $package){

if($startAfterPackage && $startAfterPackage > ($i+1)){
Expand Down

0 comments on commit 55b332d

Please sign in to comment.