Echo exceptions in multiprocessing

This commit is contained in:
DariusIII
2019-08-12 22:20:11 +00:00
parent 23297292ce
commit 5e9e2c99bd
+8 -11
View File
@@ -295,14 +295,11 @@ class Forking
private function processEndWork()
{
switch ($this->workType) {
case 'update_per_group':
case 'releases':
$this->_executeCommand($this->dnr_path.'releases '.\count($this->work).'_"');
break;
case 'update_per_group':
$this->_executeCommand($this->dnr_path.'releases '.\count($this->work).'_"');
break;
}
}
@@ -330,7 +327,7 @@ class Forking
})->then(function () use ($group, $maxWork) {
$this->colorCli->primary('Task #'.$maxWork.' Backfilled group '.$group->name);
})->catch(function (\Throwable $exception) {
// Handle exception
echo $exception->getMessage();
});
$maxWork--;
}
@@ -422,7 +419,7 @@ class Forking
})->then(function () use ($data) {
$this->colorCli->primary('Backfilled group '.$data[0]->name);
})->catch(function (\Throwable $exception) {
// Handle exception
echo $exception->getMessage();
});
}
$pool->wait();
@@ -523,7 +520,7 @@ class Forking
$this->colorCli->primary('Updated group '.$match[0]);
}
})->catch(function (\Throwable $exception) {
// Handle exception
echo $exception->getMessage();
});
}
@@ -590,7 +587,7 @@ class Forking
})->then(function () use ($maxWork) {
$this->colorCli->primary('Task #'.$maxWork.' Finished fixing releases names');
})->catch(function (\Throwable $exception) {
// Handle exception
echo $exception->getMessage();
});
$maxWork--;
}
@@ -633,7 +630,7 @@ class Forking
})->then(function () use ($maxWork) {
$this->colorCli->primary('Task #'.$maxWork.' Finished performing release processing');
})->catch(function (\Throwable $exception) {
// Handle exception
echo $exception->getMessage();
});
$maxWork--;
}
@@ -678,7 +675,7 @@ class Forking
})->then(function () use ($desc, $count) {
$this->colorCli->primary('Finished task #'.$count.' for '.$desc);
})->catch(function (\Throwable $exception) {
// Handle exception
echo $exception->getMessage();
})->timeout(function () use ($count) {
$this->colorCli->notice('Task #'.$count.': Timeout occurred.');
});
@@ -932,7 +929,7 @@ class Forking
$name = UsenetGroup::getNameByID($group->id);
$this->colorCli->primary('Finished updating binaries, processing releases and additional postprocessing for group:'.$name);
})->catch(function (\Throwable $exception) {
// Handle exception
echo $exception->getMessage();
});
}