Symfony-Bundle
Symfony-Bundle copied to clipboard
force run didnt work whith schedule
Command example: "id" "name" "command" "schedule" "description" "enabled" "2" "test" "some:test:command" "5 0 * * *" "description" "1" I run bin/console cron:run --force test Command didnt run It can be fix by
diff --git a/Command/CronRunCommand.php b/Command/CronRunCommand.php
index a8f2fcd..fba6afb 100644
--- a/Command/CronRunCommand.php
+++ b/Command/CronRunCommand.php
@@ -85,7 +85,9 @@ class CronRunCommand extends ContainerAwareCommand
if ($dbJob->getEnabled() || $force) {
$job = new ShellJob();
$job->setCommand(escapeshellarg($phpExecutable) . ' bin/console ' . $dbJob->getCommand(), $rootDir);
- $job->setSchedule(new CrontabSchedule($dbJob->getSchedule()));
+ if (!$force) {
+ $job->setSchedule(new CrontabSchedule($dbJob->getSchedule()));
+ }
$job->raw = $dbJob;
$resolver->addJob($job);