mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Add correct Exit status
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user