Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2018 at 08:37 UTC
Updated:
16 Sep 2019 at 10:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mpp commentedComment #3
mpp commentedComment #4
jonathan1055 commentedThis is interesting. Thanks for the link to Moshe's blog and the patch. I have not used drush 9 yet. Is this issue really 'critical'? I'm not saying it isn't, but I would like to hear your views and background info.
Jonathan
Comment #5
mpp commentedHi jonathan, we can't use the cron url as we have a reverse proxy before the webserver. So Drush is our only option. Also Drush 8 is no longer supported for Drupal 8.3+.
You can set it to normal or major or keep it critical but without this patch this module becomes useless in our situation.
Regards
Comment #6
jonathan1055 commentedThanks for the info. Yes I understand now. Given that you have this patch, and no-one else has raised it yet, I will set it down to major. I just need to test it, but I don't see any problem in getting this committed.
Comment #7
idebr commented'Port' in the issue summary suggests the old code is removed, but this patch only adds new code. Let's either:
- Update the issue title
- Remove the drush 8 command
Comment #8
mpp commented@idebr, updated this issues title. It would be useful if you could provide feedback on the patch.
Comment #9
idebr commentedThe patch works fine. Some minor remarks:
There is not much added value in referring to another contributed module's implementation of dependency injection, since it is already implemented a few lines below. The comment has a Drupal code violation as well (Doc comment long description must end with a full stop), so I would suggest removing these lines altogether.
Lighweight -> Lightweight
Comment #10
mpp commentedGood point, fixed the typo and removed the redundant documentation.
Comment #12
gchauhan commentedComment #14
mpp commented@gchauhan: the cron() method in your patch is not doing anything, not sure what you're trying to do here?
Could you provide an interdiff?
Comment #15
jonathan1055 commentedThe change to composer.json looks mostly like re-formatting, is this for coding standards? If so, it should be in a separate issue as it confuses things here. An interdiff would be very helpful.
Comment #16
mpp commented@jonathan1055, the composer file now contains a link to the drush service:
+ "license": "GPL-2.0+",
+ "extra": {
+ "drush": {
+ "services": {
+ "drush.services.yml": "^9"
+ }
+ }
}
Comment #17
pcate commentedAttached is a new patch I made to add this functionality, since a client will be needing it soon. I had some trouble applying the previous ones so I started from scratch.
I also fixed a small typo in the drush 8
scheduler.drush.incfile.Comment #18
pcate commentedComment #20
pcate commentedJust a followup to my submitted patch. As I mentioned I had trouble with previous patch. That was #12 which didn't work for me. Looking at the code for #10 however it looks like that would have worked fine. As such my patch and @mpp #12 patch seem to accomplish the same thing.
Comment #21
jonathan1055 commentedThank you @PCate and @mpp. I have compared the patches in #10 and #17 and taken the best from each (even though they mostly did the same thing). I have also enhanced the command by adding another option --nolog which will inhibit the 'started' and 'completed' lines from being written to the dblog (and hence also the terminal) even if the site config setting has this on, i.e. it can override the site setting. I also added an indication in the log message to show if the cron had been activated from drush, admin user form or the url.
Thanks for spotting the typos, I have moved them out of this patch and already committed them - see #3033108-24: Miscellaneous changes before Scheduler 8.x-1.1
One question, in patch #10 we had:
But in the #17 patch the call to
parent::__construct()is missing. What is the best practice here? Should this be in? Works OK without at the moment.This patch has all the changes, plus additions to composer.json in an attempt to have green passing tests. The problem is caused by #2985051: Patching composer.json shows we need to add module dependencies
I would like to commit the drush9 changes within the next few days, as the new release of Scheduler is imminent and it would be very good to have this feature included. Please test and let me have any feedback asap. Thanks!
Comment #22
pcate commentedI just finished testing the patch. It applied cleanly to the latest dev version and worked fine for me.
Comment #23
jonathan1055 commentedThanks @PCate for testing, good to hear it worked, and thank you for the prompt reply.
I found this stackoverflow answer to my question about
parent::__constructso have decided to leave it in.Comment #25
jonathan1055 commentedThanks all. It is good that this addition will now make it into Scheduler 8.x-1.1 which is coming very soon.
Comment #26
mpp commentedThansk @jonathan1055. And yes, we should leave it in :-)
Comment #27
jonathan1055 commentedSomehow in using code from both the patches I managed to get the property names
$managerand$schedulerManagermuddled. The commands did work, and I tested it all, but must have then renamed the property from PCate's patch to match mpp's but not got it right.Issue #3078674: Call to function runLightweightCron() on null in SchedulerCommands->cron() has the fix.
I had been wondering about how to write phpunit tests to check drush commands. If we had some, then this typo could have been detected.