diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 64e3230..2e2b7e1 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -36,6 +36,7 @@ public function getConfigTreeBuilder() ->scalarNode('model_class')->isRequired()->cannotBeEmpty()->end() ->scalarNode('model_id')->defaultValue('id')->cannotBeEmpty()->end() ->scalarNode('repository_method')->defaultValue('find')->cannotBeEmpty()->end() + ->scalarNode('delivery_delay')->defaultNull()->end() ->end() ; diff --git a/Doctrine/SyncIndexWithObjectChangeListener.php b/Doctrine/SyncIndexWithObjectChangeListener.php index d286a94..5f8c635 100644 --- a/Doctrine/SyncIndexWithObjectChangeListener.php +++ b/Doctrine/SyncIndexWithObjectChangeListener.php @@ -85,6 +85,6 @@ private function sendUpdateIndexMessage($action, LifecycleEventArgs $args) 'repository_method' => $this->config['repository_method'], ])); - $this->context->createProducer()->send($queue, $message); + $this->context->createProducer()->setDeliveryDelay($this->config['delivery_delay'])->send($queue, $message); } }