Add correct Exit status

This commit is contained in:
Romain Neutron
2012-03-26 13:48:06 +02:00
parent 14c4853789
commit f85d159ea0
13 changed files with 39 additions and 27 deletions

View File

@@ -24,6 +24,7 @@ use Symfony\Component\Console\Command\Command;
class module_console_schedulerState extends Command
{
public function __construct($name = null)
{
parent::__construct($name);
@@ -35,28 +36,32 @@ class module_console_schedulerState extends Command
public function execute(InputInterface $input, OutputInterface $output)
{
if(!setup::is_installed())
if ( ! setup::is_installed())
{
throw new RuntimeException('Phraseanet is not set up');
}
require_once dirname(__FILE__) . '/../../../../lib/bootstrap.php';
$appbox = appbox::get_instance();
$appbox = appbox::get_instance();
$task_manager = new task_manager($appbox);
$state = $task_manager->get_scheduler_state();
if ($state['schedstatus'] == 'started')
{
$output->writeln(sprintf(
'Scheduler is %s on pid %d'
, $state['schedstatus']
, $state['schedpid']
));
'Scheduler is %s on pid %d'
, $state['schedstatus']
, $state['schedpid']
));
}
else
{
$output->writeln(sprintf('Scheduler is %s', $state['schedstatus']));
}
return;
return 0;
}
}