New cron initialization and minor edits (#619)

* New cron initialization and minor edits

Updated the mechanism to check if cron needs to run and made minor improvements to the first run

* Adding a warning in the control panel
This commit is contained in:
Yury Pikhtarev 2023-03-17 19:26:07 +07:00 committed by GitHub
commit e4b6a91909
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 37 additions and 11 deletions

View file

@ -405,7 +405,12 @@ $userdata =& $user->data;
/**
* Cron
*/
if ((empty($_POST) && !defined('IN_ADMIN') && !defined('IN_AJAX') && !file_exists(CRON_RUNNING) && ($bb_cfg['cron_enabled'] || defined('START_CRON'))) || defined('FORCE_CRON')) {
if (
empty($_POST) &&
!defined('IN_ADMIN') && !defined('IN_AJAX') &&
!file_exists(CRON_RUNNING) &&
(TorrentPier\Helpers\CronHelper::isEnabled() || defined('START_CRON'))
) {
if (TIMENOW - $bb_cfg['cron_last_check'] > $bb_cfg['cron_check_interval']) {
/** Update cron_last_check */