mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
RESTORE-INDEXER-TASK
#time 1h
This commit is contained in:
@@ -79,6 +79,7 @@ class TasksServiceProvider implements ServiceProviderInterface
|
|||||||
return $app['notification.deliverer'];
|
return $app['notification.deliverer'];
|
||||||
}),
|
}),
|
||||||
new ArchiveJob($app['translator'], $app['dispatcher'], $logger),
|
new ArchiveJob($app['translator'], $app['dispatcher'], $logger),
|
||||||
|
new IndexerJob($app['translator'], $app['dispatcher'], $logger),
|
||||||
new BridgeJob($app['translator'], $app['dispatcher'], $logger),
|
new BridgeJob($app['translator'], $app['dispatcher'], $logger),
|
||||||
new FtpPullJob($app['translator'], $app['dispatcher'], $logger),
|
new FtpPullJob($app['translator'], $app['dispatcher'], $logger),
|
||||||
new RecordMoverJob($app['translator'], $app['dispatcher'], $logger),
|
new RecordMoverJob($app['translator'], $app['dispatcher'], $logger),
|
||||||
|
45
lib/Alchemy/Phrasea/TaskManager/Editor/IndexerEditor.php
Normal file
45
lib/Alchemy/Phrasea/TaskManager/Editor/IndexerEditor.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2014 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
namespace Alchemy\Phrasea\TaskManager\Editor;
|
||||||
|
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
|
||||||
|
class IndexerEditor extends AbstractEditor
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getTemplatePath()
|
||||||
|
{
|
||||||
|
return 'admin/task-manager/task-editor/indexer.html.twig';
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDefaultPeriod()
|
||||||
|
{
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDefaultSettings(PropertyAccess $config = null)
|
||||||
|
{
|
||||||
|
return <<<XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<tasksettings></tasksettings>
|
||||||
|
XML;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getFormProperties()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
50
lib/Alchemy/Phrasea/TaskManager/Job/IndexerJob.php
Normal file
50
lib/Alchemy/Phrasea/TaskManager/Job/IndexerJob.php
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is part of Phraseanet
|
||||||
|
*
|
||||||
|
* (c) 2005-2014 Alchemy
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
namespace Alchemy\Phrasea\TaskManager\Job;
|
||||||
|
use Alchemy\Phrasea\TaskManager\Editor\IndexerEditor;
|
||||||
|
class IndexerJob extends AbstractJob
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->translator->trans('Indexation task');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getJobId()
|
||||||
|
{
|
||||||
|
return 'Indexer';
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getDescription()
|
||||||
|
{
|
||||||
|
return $this->translator->trans("Indexing Batch (collections/databox)");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function getEditor()
|
||||||
|
{
|
||||||
|
return new IndexerEditor($this->translator);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function doJob(JobData $data)
|
||||||
|
{
|
||||||
|
$app = $data->getApplication();
|
||||||
|
$app['elasticsearch.indexer']->indexScheduledRecords();
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1 @@
|
|||||||
|
{% extends 'admin/task-manager/task-editor/task.html.twig' %}
|
Reference in New Issue
Block a user