Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Added sys:cron:schedule command #257
Magerun pull-request check-list:
Sometimes we want to run a cronjob, but not keep our ssh session or terminal open while running
Possible discussion points:
If there are any remarks, let me know!
Current coverage is 51.09% (diff: 16.36%)
@@ develop #257 diff @@ ========================================== Files 195 196 +1 Lines 8609 8664 +55 Methods 865 869 +4 Messages 0 0 Branches 0 0 ========================================== + Hits 4418 4427 +9 - Misses 4191 4237 +46 Partials 0 0
For the wording, please also take a look with Magerun 1 where - IIRC - a cron schedule command exists. In any case this should be backwards compatible. If this does not match, let's defer the details. But if you can, take a look.
If you can refactor it into a model class, I'd say it's preferable over an abstract base class as we should favor aggregation over inheritance. You can place such a model class next to those command classes (in the same directory). This might take more time than pushing members down to a new abstract-base-class. You're open to do it the way you prefer (or what currently works best for you), so no hard rules here. Historically, abstract classes were preferred, for me personally that's not my style but just find your way that is practically for you right now.
From this quick glance over the last days (was looking in there because of some Magerun 1 cron command), I'd say the use of strftime within Magento core definitely is a smell and I wondered why Magento core makes use of it for timestamps stored into the database system. Really.
For your question: I would prefer to not duplicate any work-arounds (if there are any) but instead do as documented:
Generally it would be great if you could increase code-coverage. Code looks generally good, I've left some quick comments. If you want to already extract functionality, you can do so if you like but it's not a necessity. IMHO code coverage is more important so that it's possible to refactor more easily later on.
Thanks a lot for you PR. If you have any feedback on my feedback just shoot!
Sorry for the delay, but I just found time to update this PR and I think I addressed most of your remarks. If you have new remarks, please let me know.
I chose to move the
As far as I can see, there is no such command in Magerun 1, so the naming is still open for discussion :)