Skip to content

Commit b304deb

Browse files
kbondfabpot
authored andcommitted
add debug:scheduler command
1 parent ce0977b commit b304deb

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,10 @@ private function registerSchedulerConfiguration(array $config, ContainerBuilder
20162016
}
20172017

20182018
$loader->load('scheduler.php');
2019+
2020+
if (!$this->hasConsole()) {
2021+
$container->removeDefinition('console.command.scheduler_debug');
2022+
}
20192023
}
20202024

20212025
private function registerMessengerConfiguration(array $config, ContainerBuilder $container, PhpFileLoader $loader, bool $validationEnabled): void

Resources/config/console.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@
4242
use Symfony\Component\Console\EventListener\ErrorListener;
4343
use Symfony\Component\Dotenv\Command\DebugCommand as DotenvDebugCommand;
4444
use Symfony\Component\Messenger\Command\ConsumeMessagesCommand;
45-
use Symfony\Component\Messenger\Command\DebugCommand;
45+
use Symfony\Component\Messenger\Command\DebugCommand as MessengerDebugCommand;
4646
use Symfony\Component\Messenger\Command\FailedMessagesRemoveCommand;
4747
use Symfony\Component\Messenger\Command\FailedMessagesRetryCommand;
4848
use Symfony\Component\Messenger\Command\FailedMessagesShowCommand;
4949
use Symfony\Component\Messenger\Command\SetupTransportsCommand;
5050
use Symfony\Component\Messenger\Command\StatsCommand;
5151
use Symfony\Component\Messenger\Command\StopWorkersCommand;
52+
use Symfony\Component\Scheduler\Command\DebugCommand as SchedulerDebugCommand;
5253
use Symfony\Component\Translation\Command\TranslationPullCommand;
5354
use Symfony\Component\Translation\Command\TranslationPushCommand;
5455
use Symfony\Component\Translation\Command\XliffLintCommand;
@@ -172,7 +173,7 @@
172173
])
173174
->tag('console.command')
174175

175-
->set('console.command.messenger_debug', DebugCommand::class)
176+
->set('console.command.messenger_debug', MessengerDebugCommand::class)
176177
->args([
177178
[], // Message to handlers mapping
178179
])
@@ -218,6 +219,12 @@
218219
])
219220
->tag('console.command')
220221

222+
->set('console.command.scheduler_debug', SchedulerDebugCommand::class)
223+
->args([
224+
tagged_locator('scheduler.schedule_provider', 'name'),
225+
])
226+
->tag('console.command')
227+
221228
->set('console.command.router_debug', RouterDebugCommand::class)
222229
->args([
223230
service('router'),

0 commit comments

Comments
 (0)