This commit is contained in:
Roman Kelesidis 2024-08-04 22:51:44 +07:00
commit f5227b4083
24 changed files with 26 additions and 24 deletions

View file

@ -46,6 +46,7 @@ foreach ($cron_jobs as $job) {
if (is_file($job_script)) {
$cron_start_time = utime();
$cron_runtime_log = [];
$cronjob_completed = false;
$cron_write_log = (CRON_LOG_ENABLED && (CRON_FORCE_LOG || $job['log_enabled'] >= 1));
$cron_sql_log_file = CRON_LOG_DIR . '/SQL-' . basename($job['cron_script']);
@ -90,7 +91,7 @@ foreach ($cron_jobs as $job) {
}
}
if (!defined('CRONJOB_COMPLETED') || !CRONJOB_COMPLETED) {
if (!$cronjob_completed) {
return;
}

View file

@ -213,4 +213,4 @@ DB()->query("DROP TEMPORARY TABLE $tmp_attach_tbl");
unset($fix_errors, $debug_mode);
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -66,4 +66,4 @@ $datastore->update('check_updates');
$datastore->update('files_integrity');
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -85,4 +85,4 @@ DB()->query("
");
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -18,4 +18,4 @@ if ($log_days_keep !== 0) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -40,4 +40,4 @@ if ($pm_days_keep !== 0) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -19,4 +19,4 @@ DB()->query("
");
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -44,4 +44,4 @@ foreach (file($dump_path) as $line) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -14,4 +14,4 @@ if (!defined('BB_ROOT')) {
$datastore->update('cat_forums');
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -14,4 +14,4 @@ if (!defined('BB_ROOT')) {
$datastore->update('stats');
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -35,4 +35,4 @@ DB()->query("DELETE buf FROM " . BUF_TOPIC_VIEW . " buf");
DB()->unlock();
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -20,4 +20,4 @@ if ($bb_cfg['prune_enable']) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -55,4 +55,4 @@ while (true) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -22,4 +22,4 @@ if ($bb_cfg['topic_moved_days_keep']) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -54,4 +54,4 @@ DB()->query("
");
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -23,4 +23,4 @@ if (is_file(SITEMAP_DIR . '/sitemap.xml')) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -160,4 +160,4 @@ DB()->query("
DB()->query("DROP TABLE IF EXISTS " . NEW_BB_BT_LAST_USERSTAT . ", " . OLD_BB_BT_LAST_USERSTAT);
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -66,4 +66,4 @@ if ($bb_cfg['ocelot']['enabled']) {
}*/
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -62,4 +62,4 @@ if ($dead_tor_sql && $attach_sql) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -193,4 +193,4 @@ if ($bb_cfg['torhelp_enabled']) {
DB()->expect_slow_query(10);
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -71,4 +71,4 @@ if ($bb_cfg['seed_bonus_enabled'] && $bb_cfg['seed_bonus_points'] && $bb_cfg['se
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -25,4 +25,4 @@ DB()->query("
DB()->query("TRUNCATE TABLE " . BUF_LAST_SEEDER);
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -35,4 +35,4 @@ foreach ($forums_data as $forum_data) {
}
// Cron completed
define('CRONJOB_COMPLETED', true);
$cronjob_completed = true;

View file

@ -32,13 +32,14 @@ class Cron
bb_die('Could not obtain cron script');
}
$cronjob_completed = false;
while ($row = DB()->sql_fetchrow($result)) {
$job = $row['cron_script'];
$job_script = INC_DIR . '/cron/jobs/' . $job;
require($job_script);
}
if (!defined('CRONJOB_COMPLETED') || !CRONJOB_COMPLETED) {
if (!$cronjob_completed) {
return;
}