-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register the maintenance job for update queue processing in Pimcore 6 (…
…#86) * Add new maintenance task for Pimcore v6 support * Move legacy job registration logic to new class
- Loading branch information
Showing
3 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
|
||
namespace AdvancedObjectSearchBundle\Maintenance; | ||
|
||
|
||
use AdvancedObjectSearchBundle\Service; | ||
use Pimcore\Event\System\MaintenanceEvent; | ||
use Pimcore\Maintenance\TaskInterface; | ||
use Pimcore\Model\Schedule\Maintenance\Job; | ||
|
||
class UpdateQueueProcessor implements TaskInterface | ||
{ | ||
/** | ||
* @var Service | ||
*/ | ||
protected $service; | ||
|
||
public function __construct(Service $service) | ||
{ | ||
$this->service = $service; | ||
} | ||
|
||
/** | ||
* Note: When Pimcore v5 support is dropped, this can be removed. | ||
*/ | ||
public function registerMaintenanceJob(MaintenanceEvent $maintenanceEvent) | ||
{ | ||
$maintenanceEvent->getManager()->registerJob(new Job(get_class($this), [$this, "execute"])); | ||
} | ||
|
||
public function execute() | ||
{ | ||
$this->service->processUpdateQueue(500); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters