diff --git a/bin/console b/bin/console
index 267910c063..dc078a3662 100755
--- a/bin/console
+++ b/bin/console
@@ -30,13 +30,15 @@ use Alchemy\Phrasea\Command\Plugin\RemovePlugin;
use Alchemy\Phrasea\Command\CheckConfig;
use Alchemy\Phrasea\Command\Setup\XSendFileMappingGenerator;
use Alchemy\Phrasea\Command\Setup\XSendFileConfigurationDumper;
-use Alchemy\Phrasea\Command\Task\SchedulerStart;
+use Alchemy\Phrasea\Command\Task\SchedulerResumeTasks;
use Alchemy\Phrasea\Command\Task\SchedulerState;
-use Alchemy\Phrasea\Command\Task\SchedulerStop;
+use Alchemy\Phrasea\Command\Task\SchedulerPauseTasks;
+use Alchemy\Phrasea\Command\Task\SchedulerRun;
use Alchemy\Phrasea\Command\Task\TaskList;
use Alchemy\Phrasea\Command\Task\TaskRun;
+use Alchemy\Phrasea\Command\Task\TaskStart;
+use Alchemy\Phrasea\Command\Task\TaskStop;
use Alchemy\Phrasea\Command\Task\TaskState;
-use Alchemy\Phrasea\Command\Task\TaskManagerCommand;
require_once __DIR__ . '/../lib/autoload.php';
@@ -83,11 +85,13 @@ $cli->command(new \module_console_systemExport('system:export'));
$cli->command(new TaskRun());
$cli->command(new TaskList());
$cli->command(new TaskState());
-$cli->command(new SchedulerStart());
-$cli->command(new SchedulerStop());
+$cli->command(new SchedulerResumeTasks());
+$cli->command(new SchedulerPauseTasks());
$cli->command(new SchedulerState());
-$cli->command(new TaskManagerCommand());
+$cli->command(new SchedulerRun());
$cli->command(new TaskList());
+$cli->command(new TaskStart());
+$cli->command(new TaskStop());
$cli->command(new MailTest('mail:test'));
diff --git a/lib/Alchemy/Phrasea/Command/Task/SchedulerStop.php b/lib/Alchemy/Phrasea/Command/Task/SchedulerPauseTasks.php
similarity index 85%
rename from lib/Alchemy/Phrasea/Command/Task/SchedulerStop.php
rename to lib/Alchemy/Phrasea/Command/Task/SchedulerPauseTasks.php
index d18dda2813..daf0855c6b 100644
--- a/lib/Alchemy/Phrasea/Command/Task/SchedulerStop.php
+++ b/lib/Alchemy/Phrasea/Command/Task/SchedulerPauseTasks.php
@@ -16,12 +16,12 @@ use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-class SchedulerStop extends Command
+class SchedulerPauseTasks extends Command
{
public function __construct()
{
- parent::__construct('task-manager:scheduler:stop');
- $this->setDescription('Starts Task-Manager scheduler. It updates the scheduler configuration.');
+ parent::__construct('task-manager:scheduler:pause-tasks');
+ $this->setDescription('Pause scheduler started tasks jobs');
}
protected function doExecute(InputInterface $input, OutputInterface $output)
diff --git a/lib/Alchemy/Phrasea/Command/Task/SchedulerStart.php b/lib/Alchemy/Phrasea/Command/Task/SchedulerResumeTasks.php
similarity index 86%
rename from lib/Alchemy/Phrasea/Command/Task/SchedulerStart.php
rename to lib/Alchemy/Phrasea/Command/Task/SchedulerResumeTasks.php
index df02e2d64d..eccbfec1a7 100644
--- a/lib/Alchemy/Phrasea/Command/Task/SchedulerStart.php
+++ b/lib/Alchemy/Phrasea/Command/Task/SchedulerResumeTasks.php
@@ -16,12 +16,12 @@ use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-class SchedulerStart extends Command
+class SchedulerResumeTasks extends Command
{
public function __construct()
{
- parent::__construct('task-manager:scheduler:start');
- $this->setDescription('Starts Task-Manager scheduler');
+ parent::__construct('task-manager:scheduler:resume-tasks');
+ $this->setDescription('Resume scheduler started tasks jobs');
}
protected function doExecute(InputInterface $input, OutputInterface $output)
diff --git a/lib/Alchemy/Phrasea/Command/Task/TaskManagerCommand.php b/lib/Alchemy/Phrasea/Command/Task/SchedulerRun.php
similarity index 93%
rename from lib/Alchemy/Phrasea/Command/Task/TaskManagerCommand.php
rename to lib/Alchemy/Phrasea/Command/Task/SchedulerRun.php
index fa14a91b0b..be88299c3c 100644
--- a/lib/Alchemy/Phrasea/Command/Task/TaskManagerCommand.php
+++ b/lib/Alchemy/Phrasea/Command/Task/SchedulerRun.php
@@ -18,11 +18,12 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-class TaskManagerCommand extends Command
+class SchedulerRun extends Command
{
public function __construct()
{
parent::__construct('task-manager:scheduler:run');
+ $this->setDescription('Run the scheduler');
}
public function signalHandler($signal)
diff --git a/lib/Alchemy/Phrasea/Command/Task/SchedulerState.php b/lib/Alchemy/Phrasea/Command/Task/SchedulerState.php
index fc7ed7de6e..f5d310dbef 100644
--- a/lib/Alchemy/Phrasea/Command/Task/SchedulerState.php
+++ b/lib/Alchemy/Phrasea/Command/Task/SchedulerState.php
@@ -23,7 +23,7 @@ class SchedulerState extends Command
{
parent::__construct('task-manager:scheduler:state');
$this
- ->setDescription('Returns Task-Manager scheduler state')
+ ->setDescription('Returns scheduler state')
->addOption('short', null, InputOption::VALUE_NONE, 'print short result, ie: stopped() | started(12345) | tostop(12345) | stopping(12345)');
}
diff --git a/lib/Alchemy/Phrasea/Command/Task/TaskList.php b/lib/Alchemy/Phrasea/Command/Task/TaskList.php
index 5531f2213c..7b1e166669 100644
--- a/lib/Alchemy/Phrasea/Command/Task/TaskList.php
+++ b/lib/Alchemy/Phrasea/Command/Task/TaskList.php
@@ -21,6 +21,7 @@ class TaskList extends Command
public function __construct()
{
parent::__construct('task-manager:task:list');
+ $this->setDescription('Lists tasks');
}
protected function doExecute(InputInterface $input, OutputInterface $output)
@@ -30,7 +31,7 @@ class TaskList extends Command
$rows = array_map(function (Task $task) use ($probe, &$errors) {
$info = $probe->getTask($task);
- $error = $info['actual'] !== $info['configuration'];
+ $error = $info['actual'] !== $task->getStatus();
if ($error) {
$errors ++;
}
@@ -38,8 +39,8 @@ class TaskList extends Command
return array(
$task->getId(),
$task->getName(),
- $task->getStatus(),
- $error ? "" . $info['actual'] . "" : $info['actual'],
+ $task->getStatus() !== 'started' ? $task->getStatus() . " (warning)" : $task->getStatus(),
+ $error ? $info['actual'] . " (error)" : $info['actual'],
$info['process-id'],
);
}, $this->container['manipulator.task']->getRepository()->findAll());
diff --git a/lib/Alchemy/Phrasea/Command/Task/TaskRun.php b/lib/Alchemy/Phrasea/Command/Task/TaskRun.php
index 535c5ed963..6ad8f7f35a 100644
--- a/lib/Alchemy/Phrasea/Command/Task/TaskRun.php
+++ b/lib/Alchemy/Phrasea/Command/Task/TaskRun.php
@@ -31,7 +31,9 @@ class TaskRun extends Command
{
parent::__construct('task-manager:task:run');
- $this->addArgument('task_id', InputArgument::REQUIRED, 'The id of the task to run', null)
+ $this
+ ->setDescription('Runs a task')
+ ->addArgument('task_id', InputArgument::REQUIRED, 'The id of the task to run', null)
->addOption('max-memory', null, InputOption::VALUE_REQUIRED, '')
->addOption('max-duration', null, InputOption::VALUE_REQUIRED, '')
->addOption('listen-signal', null, InputOption::VALUE_NONE, '')
diff --git a/lib/Alchemy/Phrasea/Command/Task/TaskState.php b/lib/Alchemy/Phrasea/Command/Task/TaskState.php
index ce1c2f1cb9..dcde820946 100644
--- a/lib/Alchemy/Phrasea/Command/Task/TaskState.php
+++ b/lib/Alchemy/Phrasea/Command/Task/TaskState.php
@@ -25,7 +25,7 @@ class TaskState extends Command
$this
->addArgument('task_id', InputArgument::REQUIRED, 'The task_id to test')
- ->setDescription('Returns a Phraseanet task state given its id')
+ ->setDescription('Returns the state of a task')
->addOption('short', null, InputOption::VALUE_NONE, 'print short result, ie: stopped() | started(12345) | tostop(12345) | ...');
}
diff --git a/lib/Alchemy/Phrasea/TaskManager/TaskList.php b/lib/Alchemy/Phrasea/TaskManager/TaskList.php
index 8c0dde9490..4380f7ffa5 100644
--- a/lib/Alchemy/Phrasea/TaskManager/TaskList.php
+++ b/lib/Alchemy/Phrasea/TaskManager/TaskList.php
@@ -53,7 +53,7 @@ class TaskList implements TaskListInterface
$arguments[] = $this->root . '/bin/console';
$arguments[] = '--';
$arguments[] = '-q';
- $arguments[] = 'task:run';
+ $arguments[] = 'task-manager:task:run';
$arguments[] = $task->getId();
$arguments[] = '--listen-signal';
$arguments[] = '--max-duration';