Skip to content

Commit

Permalink
Allow to configure custom reboot strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Baldinof committed Jan 16, 2022
1 parent a5b3f36 commit f3ab8af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/DependencyInjection/BaldinofRoadRunnerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ public function load(array $configs, ContainerBuilder $container): void
$container
->register(KernelRebootStrategyInterface::class, AlwaysRebootStrategy::class)
->setAutoconfigured(true);
} else {
} elseif ($config['kernel_reboot']['strategy'] === Configuration::KERNEL_REBOOT_STRATEGY_ON_EXCEPTION) {
$container
->register(KernelRebootStrategyInterface::class, OnExceptionRebootStrategy::class)
->addArgument($config['kernel_reboot']['allowed_exceptions'])
->addArgument(new Reference(LoggerInterface::class))
->setAutoconfigured(true)
->addTag('monolog.logger', ['channel' => self::MONOLOG_CHANNEL]);
} else {
$container->setAlias(KernelRebootStrategyInterface::class, $config['kernel_reboot']['strategy']);
}

$container->setParameter('baldinof_road_runner.middlewares', $config['middlewares']);
Expand Down

0 comments on commit f3ab8af

Please sign in to comment.