Fixed HTTP 500 while cron running in server-side (#1321)

* Fixed HTTP 500 while cron running in server-side

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-01-17 13:08:43 +07:00 committed by GitHub
commit 9b10b16460
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -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))

View file

@ -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);
}
}
}