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

@ -33,7 +33,7 @@ if (!IS_SUPER_ADMIN) {
bb_die($lang['NOT_ADMIN']);
}
$sql = DB()->fetch_rowset('SELECT * FROM ' . BB_CONFIG . " WHERE config_name = 'cron_enabled' OR config_name = 'cron_check_interval'");
$sql = DB()->fetch_rowset('SELECT * FROM ' . BB_CONFIG . " WHERE config_name = 'cron_check_interval'");
foreach ($sql as $row) {
$config_name = $row['config_name'];
@ -48,7 +48,7 @@ foreach ($sql as $row) {
}
$template->assign_vars(array(
'CRON_ENABLED' => $new['cron_enabled'] ? true : false,
'CRON_ENABLED' => TorrentPier\Helpers\CronHelper::isEnabled(),
'CRON_CHECK_INTERVAL' => $new['cron_check_interval'],
));