Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (*)
Some improvements were done previously to
cron.php
in #2380, including a refactor to$isShellDisabled
which decides whether or not to use the shell generate the cron schedules and run them.The problem comes from the condition
!str_contains(strtolower(PHP_OS), 'win')
, which is the opposite of what it should be and it'll cause the cron events to be dispatched twice from the lines below:magento-lts/cron.php
Lines 74 to 79 in e2d5fed
This was likely caused by confusion over the fact that PHP_OS is set to Darwin in macOS (@fballiano's OS), so with the negation operator it's actually resulting in false which is what you'd expect in a non-win system, so I went ahead and checked for that too.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
var_dump($isShellDisabled)
tocron.php
before thetry catch
block, and observe the value before and after.Contribution checklist (*)