mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
changes asked on last pull requaest
This commit is contained in:
@@ -61,14 +61,20 @@ class module_console_schedulerStart extends Command
|
||||
return 1;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../../../../lib/bootstrap.php';
|
||||
|
||||
try {
|
||||
$scheduler = new task_Scheduler();
|
||||
$scheduler->run($input, $output);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return $e->getCode();
|
||||
switch($e->getCode())
|
||||
{
|
||||
case task_Scheduler::ERR_ALREADY_RUNNING: // 114 : aka EALREADY (Operation already in progress)
|
||||
$exitCode = ERR_ALREADY_RUNNING;
|
||||
break;
|
||||
default:
|
||||
$exitCode = 1; // default exit code (error)
|
||||
break;
|
||||
}
|
||||
return $exitCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -72,8 +72,6 @@ class module_console_taskState extends Command
|
||||
return self::EXITCODE_BAD_ARGUMENT;
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/../../../../lib/bootstrap.php';
|
||||
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$task_manager = new task_manager($appbox);
|
||||
|
||||
|
@@ -12,7 +12,6 @@
|
||||
/**
|
||||
* @todo write tests
|
||||
*
|
||||
* @package KonsoleKomander
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
@@ -69,6 +68,7 @@ class module_console_taskrun extends Command
|
||||
{
|
||||
if ( ! setup::is_installed()) {
|
||||
$output->writeln('Phraseanet is not set up');
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ class module_console_taskrun extends Command
|
||||
$this->task->run($runner, $input, $output);
|
||||
} catch (Exception $e) {
|
||||
$this->task->log(sprintf("taskrun : exception from 'run()', %s \n", $e->getMessage()));
|
||||
|
||||
return($e->getCode());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user