Skip to content

Commit

Permalink
added LockingTaskHandlerInterface to handler-class
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed May 15, 2017
1 parent 676c026 commit ef4b922
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion PageTree/PageTreeRouteUpdateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
use Sulu\Bundle\ContentBundle\Document\BasePageDocument;
use Sulu\Component\DocumentManager\DocumentManagerInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Task\Lock\LockingTaskHandlerInterface;

/**
* Task-Handler to update page-tree-routes.
*/
class PageTreeRouteUpdateHandler implements AutomationTaskHandlerInterface
class PageTreeRouteUpdateHandler implements AutomationTaskHandlerInterface, LockingTaskHandlerInterface
{
/**
* @var PageTreeUpdaterInterface
Expand Down Expand Up @@ -79,4 +80,12 @@ public function handle($workload)

$this->documentManager->flush();
}

/**
* {@inheritdoc}
*/
public function getLockKey($workload)
{
return self::class;
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"massive/search-bundle": "@dev",

"sulu/automation-bundle": "^1.0",
"php-task/task-bundle": "@dev",
"php-task/php-task": "@dev"
"php-task/task-bundle": "dev-feature/lock as 1.1.0",
"php-task/php-task": "dev-feature/lock as 1.1.0"
},
"suggest": {
"sulu/automation-bundle": "Allows to outsource long-running route update processes."
Expand Down

0 comments on commit ef4b922

Please sign in to comment.