Skip to content

Commit

Permalink
CR fixess
Browse files Browse the repository at this point in the history
  • Loading branch information
uro committed Aug 19, 2019
1 parent a943592 commit 600ac06
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/bundle/async_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ enqueue:
async_commands:
enabled: true
timeout: 60
prefix: ~
command_name: ~
queue_name: ~
```
## Usage
Expand Down
3 changes: 2 additions & 1 deletion docs/bundle/config_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ enqueue:
async_commands:
enabled: false
timeout: 60
prefix: ~
command_name: ~
queue_name: ~
job:
enabled: false
async_events:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public function load(array $configs, ContainerBuilder $container)
if (!is_array($client)) {
$client = [
'name' => $client,
'prefix' => '',
'command_name' => Commands::RUN_COMMAND,
'queue_name' => Commands::RUN_COMMAND,
'timeout' => 60,
];
}
Expand All @@ -26,8 +27,8 @@ public function load(array $configs, ContainerBuilder $container)
->addArgument('%kernel.project_dir%', $client['timeout'])
->addTag('enqueue.processor', [
'client' => $client['name'],
'command' => $client['prefix'].Commands::RUN_COMMAND,
'queue' => $client['prefix'].Commands::RUN_COMMAND,
'command' => $client['command_name'] ?? Commands::RUN_COMMAND,
'queue' => $client['queue_name'] ?? Commands::RUN_COMMAND,
'prefix_queue' => false,
'exclusive' => true,
])
Expand Down
3 changes: 2 additions & 1 deletion pkg/enqueue-bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ private function getAsyncCommandsConfiguration(): ArrayNodeDefinition
->children()
->booleanNode('enabled')->defaultFalse()->end()
->integerNode('timeout')->min(0)->defaultValue(60)->end()
->scalarNode('prefix')->defaultValue('')->end()
->scalarNode('command_name')->defaultNull()->end()
->scalarNode('queue_name')->defaultNull()->end()
->end()
->addDefaultsIfNotSet()
->canBeEnabled()
Expand Down
3 changes: 2 additions & 1 deletion pkg/enqueue-bundle/DependencyInjection/EnqueueExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ private function loadAsyncCommands(array $config, ContainerBuilder $container):
$configs[] = [
'name' => $name,
'timeout' => $modules['async_commands']['timeout'],
'prefix' => $modules['async_commands']['prefix'],
'command_name' => $modules['async_commands']['command_name'],
'queue_name' => $modules['async_commands']['queue_name'],
];
}
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/enqueue-bundle/Tests/Functional/App/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ enqueue:
async_commands:
enabled: true
timeout: 60
prefix: ''
command_name: ~
queue_name: ~

services:
test_enqueue.client.default.traceable_producer:
Expand Down

0 comments on commit 600ac06

Please sign in to comment.