-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.2] task start scheduler on friend site via webcron #37878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Konstantin Kolos <[email protected]>
Co-authored-by: Konstantin Kolos <[email protected]>
|
I can not see any SQL script changes in this PR to add the new plugin to the extensions table, neither in base.sql for new installation nor in a new update SQL script for updates. |
|
i'll add... |
Yes, it is testable in this state … but not mergeable ;-) |
|
@alikon Update: Silly me, that’s not needed here. |
|
@alikon In addition, make sure to use the right “ordering” values in the I sent statements in the update SQL script. The values should be the same as in base.sql, but currently they are different in your PR (16 in the update SQL versus 5 in base.sql). |
|
@richard67 frankly speaking i don't think... those are "strictly" needed. p.s |
Update: Sorry for the confusion. I just see we don’t need that here in this case.
Use value 5 and not 16 in the update SQL script. |
@alikon I just see I was wrong, we do not need INSERT IGNORE here, it was for other cases where we used IDs. Sorry for the confusion. |
| @@ -0,0 +1,2 @@ | |||
| INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES | |||
| (0, 'plg_task_webcronstart', 'plugin', 'webcronstart', 'task', 0, 1, 1, 0, 0, '', '{}', '', 16, 0); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| (0, 'plg_task_webcronstart', 'plugin', 'webcronstart', 'task', 0, 1, 1, 0, 0, '', '{}', '', 16, 0); | |
| (0, 'plg_task_webcronstart', 'plugin', 'webcronstart', 'task', 0, 1, 1, 0, 0, '', '{}', '', 5, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- Add plugins to "#__extensions"
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
(0, 'plg_system_schedulerunner', 'plugin', 'schedulerunner', 'system', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_system_tasknotification', 'plugin', 'tasknotification', 'system', 0, 1, 1, 0, 1, '', '', '', 22, 0),
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0);i've choosed 16 cause is bigger than 15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ... in base.sql all task scheduler plugins seem to have values 0 to 5. No idea why it was done differently in that update SQL script. Maybe someone else has an idea.
| @@ -0,0 +1,2 @@ | |||
| INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES | |||
| (0, 'plg_task_webcronstart', 'plugin', 'webcronstart', 'task', 0, 1, 1, 0, 0, '', '{}', '', 16, 0); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| (0, 'plg_task_webcronstart', 'plugin', 'webcronstart', 'task', 0, 1, 1, 0, 0, '', '{}', '', 16, 0); | |
| (0, 'plg_task_webcronstart', 'plugin', 'webcronstart', 'task', 0, 1, 1, 0, 0, '', '{}', '', 5, 0); |
|
After site A has the PR applied and the New Task plugin enabled the site crashes - JROOT\plugins\task\webcronstart\services\provider.php:49 Did the following to get back to the back end:
|
|
good spot fixed |
|
I have tested this item ✅ successfully on f9a26af This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37878. |
| name="url" | ||
| type="text" | ||
| label="PLG_TASK_WEBCRONSTART_URL_LABEL" | ||
| description="PLG_TASK_WEBCRONSTART_URL_DESC" | ||
| required="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| name="url" | |
| type="text" | |
| label="PLG_TASK_WEBCRONSTART_URL_LABEL" | |
| description="PLG_TASK_WEBCRONSTART_URL_DESC" | |
| required="true" | |
| name="url" | |
| type="text" | |
| label="PLG_TASK_WEBCRONSTART_URL_LABEL" | |
| description="PLG_TASK_WEBCRONSTART_URL_DESC" | |
| required="true" |
| <language tag="en-GB">language/en-GB/plg_task_webcronstart.ini</language> | ||
| <language tag="en-GB">language/en-GB/plg_task_webcronstart.sys.ini</language> | ||
| </languages> | ||
| </extension> No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add EOF
| PLG_TASK_WEBCRONSTART_XML_DESCRIPTION="Start the webcron service for the friend site." | ||
| PLG_TASK_WEBCRONSTART_URL_LABEL="Site URL" | ||
| PLG_TASK_WEBCRONSTART_URL_DESC="The URL of the site to start the webcron service for." | ||
| PLG_TASK_WEBCRONSTART_TITLE="WebCron Starter" | ||
| PLG_TASK_WEBCRONSTART_DESC="Starts the WebCron service for the friend site." No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please alphasort and add EOF
| ; Note : All ini files need to be saved as UTF-8 | ||
|
|
||
| PLG_TASK_WEBCRONSTART="Task - Start WebCron" | ||
| PLG_TASK_WEBCRONSTART_XML_DESCRIPTION="Start the webcron service for the friend site." No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add EOF
| // Let the request take longer than 300 seconds to avoid timeout issues | ||
| try | ||
| { | ||
| $response = HttpFactory::getHttp($options)->get($params->url, [], 300); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timeout parameter is not used here
Co-authored-by: heelc29 <[email protected]>
|
I can't imagine a use case for a CMS where a remote web cron task should be executed on a regular basis. It is a CMS and not an administration panel. If it would be some kind of web hock feature for actions like an article save or user create, then ok. This plugin would be a perfect fit for the JED, but not for the core. |
|
@alikon Currently api and system tests are failing with loging in to backend after having made a new installation. The screenshot made from the failed login shows a |
|
Just wondering, where is the difference to the "Get-Request" Task, which is already in the system? |
Summary of Changes
Added a new task to start the scheduler on a friend site via Webcron
Testing Instructions
apply pr (on site A)
discover extension and install the new task plugin
enable the plugin
(on site B) site suppose that doesn't have crontab

enable the webcron
copy the link
enable some task ie (sleep) for example
on site (A)

create a new task WebCronStarter
and paste the URL copied before from (site B)
run the scheduler from cli for example
php cli/joomla.php scheduler:run(on site B)
check that the task have been executed
Actual result BEFORE applying this Pull Request
N/A
Expected result AFTER applying this Pull Request
you can schedule a task to start the scheduler on a friend site via webcron
Documentation Changes Required