Question Schedules Tasks
- Sakis Terz
-
Onderwerp Auteur
- Offline
Minder
Lees meer
- Berichten: 50
- Ontvangen bedankjes 0
5 dagen 20 uren geleden #3447
door Sakis Terz
Schedules Tasks werd gestart door Sakis Terz
Hi Ruud
I have seen your 2 Scheduled Task plugins and wonder if the old cron jobs are still needed.
Also noticed that sentence in your docs, but I am not sure what it means?
Thanks!
Sakis
I have seen your 2 Scheduled Task plugins and wonder if the old cron jobs are still needed.
Also noticed that sentence in your docs, but I am not sure what it means?
It is advised to configure thr scheduled tasks manager as Web Cron (so not as Lazy Scheduler).
Thanks!
Sakis
Graag Inloggen deelnemen aan het gesprek.
- Ruud van Lent
-
- Offline
Minder
Lees meer
- Berichten: 1785
- Ontvangen bedankjes 116
5 dagen 20 uren geleden - 5 dagen 20 uren geleden #3448
door Ruud van Lent
Beantwoord door Ruud van Lent in topic Schedules Tasks
Hi Sakis,
the scheduled tasks (which are automatically created (unpublished)) for you are replacing the 'old' crons: they do exactly the same and are still configured in the automation tab of the component.
In the next major version the old cron functionality will be removed, then only the scheduled tasks will work.
When you install the new version you will be notified of the new scheduled tasks (if not enabled), you will also be notified if you are still using the old cronjobs: this to provide a move over to this new functionality without leaving you in the dark somehow.
There are basiscally two ways to use the Core Joomla 'Lazy scheduler', out of the box it runs its tasks on the session of a visitor.
This means that timing of the cronjobs depends on a visitor visiting your site, also when the cronjob e.g. takes 10 seconds to complete the visitor will have this 10 second load.
So although this works, this is not optimal, especially for an ecommerce site.
So it is best to configure the Joomla core lazy scheduler as a webcron (it is defined in the options of the scheduler). When you do that a unique token is generated and you will be provided an URL that when visited will start the scheduled tasks component on your site.
This URL you need to set as a crontask on your server (or somewhere else), just like you now have set the two cronjobs for ochSubscriptions. You can set it to run every minute or 5 minutes.
Here is some more in-depth information from Akeeba which also uses the scheduled tasks: www.akeeba.com/documentation/admin-tools...joomlascheduled.html
the scheduled tasks (which are automatically created (unpublished)) for you are replacing the 'old' crons: they do exactly the same and are still configured in the automation tab of the component.
In the next major version the old cron functionality will be removed, then only the scheduled tasks will work.
When you install the new version you will be notified of the new scheduled tasks (if not enabled), you will also be notified if you are still using the old cronjobs: this to provide a move over to this new functionality without leaving you in the dark somehow.
There are basiscally two ways to use the Core Joomla 'Lazy scheduler', out of the box it runs its tasks on the session of a visitor.
This means that timing of the cronjobs depends on a visitor visiting your site, also when the cronjob e.g. takes 10 seconds to complete the visitor will have this 10 second load.
So although this works, this is not optimal, especially for an ecommerce site.
So it is best to configure the Joomla core lazy scheduler as a webcron (it is defined in the options of the scheduler). When you do that a unique token is generated and you will be provided an URL that when visited will start the scheduled tasks component on your site.
This URL you need to set as a crontask on your server (or somewhere else), just like you now have set the two cronjobs for ochSubscriptions. You can set it to run every minute or 5 minutes.
Here is some more in-depth information from Akeeba which also uses the scheduled tasks: www.akeeba.com/documentation/admin-tools...joomlascheduled.html
Laatst bewerkt 5 dagen 20 uren geleden doorRuud van Lent.
De volgende gebruiker (s) zei dank u: Sakis Terz
Graag Inloggen deelnemen aan het gesprek.
- Sakis Terz
-
Onderwerp Auteur
- Offline
Minder
Lees meer
- Berichten: 50
- Ontvangen bedankjes 0
4 dagen 21 uren geleden #3449
door Sakis Terz
Beantwoord door Sakis Terz in topic Schedules Tasks
FYI, when I run the Joomla cli `/cli/joomla.php scheduler:run --all`, it gives me that error:
Run Tasks ========= In OchsubscriptionsHelper.php line 490: Call to undefined method Joomla\CMS\Application\ConsoleApplication::getDocu ment() scheduler:run [-i|--id ID] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [-n|--no-interaction] ] <command>
Run Tasks ========= In OchsubscriptionsHelper.php line 490: Call to undefined method Joomla\CMS\Application\ConsoleApplication::getDocu ment() scheduler:run [-i|--id ID] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [-n|--no-interaction] ] <command>
Graag Inloggen deelnemen aan het gesprek.
- Ruud van Lent
-
- Offline
Minder
Lees meer
- Berichten: 1785
- Ontvangen bedankjes 116
4 dagen 3 uren geleden - 4 dagen 3 uren geleden #3450
door Ruud van Lent
Beantwoord door Ruud van Lent in topic Schedules Tasks
Hi Sakis,
was able to reproduce.
in ./administrator/components/com_ochsubscriptions/src/Helper/OchsubscriptionsHelper.php
add the following use statement in the top of the file:
and then replace public static function setDebugLevel(): void with the following function:
was able to reproduce.
in ./administrator/components/com_ochsubscriptions/src/Helper/OchsubscriptionsHelper.php
add the following use statement in the top of the file:
Code:
use Joomla\CMS\Application\WebApplication;
and then replace public static function setDebugLevel(): void with the following function:
Code:
public static function setDebugLevel(): void
{
$joomlaVersion = new Version();
if (\defined('OCHSUBSCRIPTIONS_DEBUG') === \false) {
if (Config::get()->enable_debug || JDEBUG) {
Log::addLogger(array('text_file' => 'com_ochsubscriptions-site-log.php'), Log::ALL, array('ochsubscriptions'));
\define('OCHSUBSCRIPTIONS_DEBUG', \true);
} else {
Log::addLogger(array('text_file' => 'com_ochsubscriptions-site-log.php'), Log::ALL & ~Log::INFO & ~Log::DEBUG, array('ochsubscriptions'));
\define('OCHSUBSCRIPTIONS_DEBUG', \false);
}
$app = Factory::getApplication();
if ($app instanceof WebApplication) {
$app->getDocument()->addScriptOptions(
'com_ochsubscriptions',
[
'debug' => OCHSUBSCRIPTIONS_DEBUG,
'version' => '___VERSION___',
'cms_version' => $joomlaVersion::MAJOR_VERSION
]
);
}
}
}
Laatst bewerkt 4 dagen 3 uren geleden doorRuud van Lent.
De volgende gebruiker (s) zei dank u: Sakis Terz
Graag Inloggen deelnemen aan het gesprek.
- Ruud van Lent
-
- Offline
Minder
Lees meer
- Berichten: 1785
- Ontvangen bedankjes 116
2 dagen 21 uren geleden #3451
door Ruud van Lent
Beantwoord door Ruud van Lent in topic Schedules Tasks
@sakis,
If you could confirm if this fixes the issue that would be great, I can then prepare a bugfix release for next week with this and other fixes.
let me know,
have a nice weekend,
Ruud.
If you could confirm if this fixes the issue that would be great, I can then prepare a bugfix release for next week with this and other fixes.
let me know,
have a nice weekend,
Ruud.
Graag Inloggen deelnemen aan het gesprek.