From e6e802a6a617aa51d4187211b62f18ca0629e353 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 8 Feb 2024 17:46:14 +0700 Subject: [PATCH] Fixed issue with poll_users cleaning at every cron job startup (#1390) * Fixed issue with poll_users cleaning at every cron job startup * Update CHANGELOG.md --- CHANGELOG.md | 1 + library/includes/cron/jobs/board_maintenance.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 658c373a4..8a01c77ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Created template file for AJAX quick actions [\#1381](https://github.com/torrentpier/torrentpier/pull/1381) ([belomaxorka](https://github.com/belomaxorka)) - Removed `wbr()` [\#1387](https://github.com/torrentpier/torrentpier/pull/1387) ([belomaxorka](https://github.com/belomaxorka)) - Removed converting for legacy md5 passwords [\#1386](https://github.com/torrentpier/torrentpier/pull/1386) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed issue with poll_users cleaning at every cron job startup [\#1390](https://github.com/torrentpier/torrentpier/pull/1390) ([belomaxorka](https://github.com/belomaxorka)) - Used hashing for filenames generation [\#1385](https://github.com/torrentpier/torrentpier/pull/1385) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383) ([belomaxorka](https://github.com/belomaxorka)) - Some bugfixes [\#1380](https://github.com/torrentpier/torrentpier/pull/1380) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/library/includes/cron/jobs/board_maintenance.php b/library/includes/cron/jobs/board_maintenance.php index d4312f5e6..73858faf5 100644 --- a/library/includes/cron/jobs/board_maintenance.php +++ b/library/includes/cron/jobs/board_maintenance.php @@ -30,7 +30,7 @@ if ($poll_max_days = (int)$bb_cfg['poll_max_days']) { DB()->query(" DELETE FROM " . BB_POLL_USERS . " WHERE topic_id BETWEEN $start_id AND $end_id - AND vote_dt < DATE_SUB(NOW(), INTERVAL $poll_max_days DAY) + AND vote_dt < " . (TIMENOW - 86400 * $poll_max_days) . " "); if ($end_id > $finish_id) {