Skip to content

Commit fcda71d

Browse files
committed
Do cleanup and generate of schedules under cron group lock
1 parent 702c93a commit fcda71d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ public function execute(\Magento\Framework\Event\Observer $observer)
199199
$phpPath = $this->phpExecutableFinder->find() ?: 'php';
200200

201201
foreach ($jobGroupsRoot as $groupId => $jobsRoot) {
202-
$this->_cleanup($groupId);
203-
$this->_generate($groupId);
204202
if ($this->_request->getParam('group') !== null
205203
&& $this->_request->getParam('group') !== '\'' . ($groupId) . '\''
206204
&& $this->_request->getParam('group') !== $groupId
@@ -234,6 +232,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
234232
continue;
235233
}
236234

235+
$this->_cleanup($groupId);
236+
$this->_generate($groupId);
237+
237238
/** @var \Magento\Cron\Model\Schedule $schedule */
238239
foreach ($pendingJobs as $schedule) {
239240
$jobConfig = isset($jobsRoot[$schedule->getJobCode()]) ? $jobsRoot[$schedule->getJobCode()] : null;

0 commit comments

Comments
 (0)