mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Rename commands
This commit is contained in:
16
bin/console
16
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'));
|
||||
|
||||
|
@@ -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)
|
@@ -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)
|
@@ -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)
|
@@ -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: <info>stopped()</info> | <info>started(12345)</info> | <info>tostop(12345)</info> | <info>stopping(12345)</info>');
|
||||
}
|
||||
|
||||
|
@@ -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 ? "<error>" . $info['actual'] . "</error>" : $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());
|
||||
|
@@ -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, '')
|
||||
|
@@ -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: <info>stopped()</info> | <info>started(12345)</info> | <info>tostop(12345)</info> | <info>...</info>');
|
||||
}
|
||||
|
||||
|
@@ -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';
|
||||
|
Reference in New Issue
Block a user