PMC-964 We need a new artisan command to manage the failed jobs, because we need to load the workspace configuration

This commit is contained in:
Roly Rudy Gutierrez Pinto
2019-07-19 09:56:20 -04:00
parent 5dcbd70771
commit 1deddc05d0
11 changed files with 218 additions and 40 deletions

View File

@@ -1493,19 +1493,17 @@ function run_artisan($args)
if ($workspace !== false) {
config(['system.workspace' => $workspace]);
$sw = in_array($args[0], ['queue:work', 'queue:listen']);
$tries = $jobsManager->getOptionValueFromArguments($args, "--tries");
if ($tries === false) {
if ($sw === true && $tries === false) {
$tries = $jobsManager->getTries();
array_push($args, "--tries={$tries}");
}
array_push($args, "--processmakerPath=" . PROCESSMAKER_PATH);
$processmakerPath = PROCESSMAKER_PATH;
$otherOptions = "--processmakerPath={$processmakerPath} ";
$options = implode(" ", $args)
. " --tries={$tries}";
CLI::logging("> artisan {$options}\n");
passthru(PHP_BINARY . " artisan {$otherOptions} {$options}");
$command = "artisan " . implode(" ", $args);
CLI::logging("> {$command}\n");
passthru(PHP_BINARY . " {$command}");
} else {
CLI::logging("> The --workspace option is undefined.\n");
}