summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2025-03-08 11:58:11 +0000
committerAndrew Dolgov <fox@fakecake.org>2025-03-08 11:58:11 +0000
commit1fc4eed6cd9d887b52ea09bab6bd1ff75c79c25c (patch)
tree5291f35577606b4ca3984fa770aba6b2a989a636 /update.php
parent9983954bf1e303a9c3136c199c1c08c4f4ed0eef (diff)
parent89b0332d3861ce2d9b37c690a32c98e961d7e219 (diff)
Merge branch 'feature/time-comparison-gen' into 'master'
Add and use 'Db::past_comparison_qpart()'. See merge request tt-rss/tt-rss!105
Diffstat (limited to 'update.php')
-rwxr-xr-xupdate.php9
1 files changed, 1 insertions, 8 deletions
diff --git a/update.php b/update.php
index d2a1287d1..471e323c8 100755
--- a/update.php
+++ b/update.php
@@ -33,14 +33,7 @@
}
function cleanup_tags(int $days = 14, int $limit = 1000): int {
-
- $days = (int) $days;
-
- if (Config::get(Config::DB_TYPE) == "pgsql") {
- $interval_query = "e.date_updated < NOW() - INTERVAL '$days days'";
- } else /*if (Config::get(Config::DB_TYPE) == "mysql") */ {
- $interval_query = "e.date_updated < DATE_SUB(NOW(), INTERVAL $days DAY)";
- }
+ $interval_query = Db::past_comparison_qpart('e.date_updated', '<', $days, 'day');
$tags_deleted = 0;
$limit_part = 500;