From 9b10b16460b72e12c798a3cca5af18678efefdbc Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 17 Jan 2024 13:08:43 +0700 Subject: [PATCH] Fixed HTTP 500 while cron running in server-side (#1321) * Fixed HTTP 500 while cron running in server-side * Update CHANGELOG.md --- CHANGELOG.md | 1 + library/includes/init_bb.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29f7f25bb..4c5732f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Used `humn_size()` to count average of releases in tr_stats.php [\#1313](https://github.com/torrentpier/torrentpier/pull/1313) ([belomaxorka](https://github.com/belomaxorka)) - Some enhancements in default template [\#1312](https://github.com/torrentpier/torrentpier/pull/1312) ([belomaxorka](https://github.com/belomaxorka)) - Set response code in some cases [\#1319](https://github.com/torrentpier/torrentpier/pull/1319) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed HTTP 500 while cron running in server-side [\#1321](https://github.com/torrentpier/torrentpier/pull/1321) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1306](https://github.com/torrentpier/torrentpier/pull/1306), [\#1307](https://github.com/torrentpier/torrentpier/pull/1307), [\#1308](https://github.com/torrentpier/torrentpier/pull/1308), [\#1315](https://github.com/torrentpier/torrentpier/pull/1315) ([belomaxorka](https://github.com/belomaxorka)) - Updated deps [\#1304](https://github.com/torrentpier/torrentpier/pull/1304), [\#1305](https://github.com/torrentpier/torrentpier/pull/1305) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 5e11ef37b..323664e7c 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -447,11 +447,15 @@ if (($bb_cfg['board_disable'] || is_file(BB_DISABLED)) && !defined('IN_ADMIN') & if ($bb_cfg['board_disable']) { // admin lock send_no_cache_headers(); - bb_die('BOARD_DISABLE', 503); + if (\TorrentPier\Helpers\CronHelper::isEnabled()) { + bb_die('BOARD_DISABLE', 503); + } } elseif (is_file(BB_DISABLED)) { // trigger lock TorrentPier\Helpers\CronHelper::releaseDeadlock(); send_no_cache_headers(); - bb_die('BOARD_DISABLE_CRON', 503); + if (\TorrentPier\Helpers\CronHelper::isEnabled()) { + bb_die('BOARD_DISABLE_CRON', 503); + } } }