diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-03-08 11:58:11 +0000 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-03-08 11:58:11 +0000 |
| commit | 1fc4eed6cd9d887b52ea09bab6bd1ff75c79c25c (patch) | |
| tree | 5291f35577606b4ca3984fa770aba6b2a989a636 /update.php | |
| parent | 9983954bf1e303a9c3136c199c1c08c4f4ed0eef (diff) | |
| parent | 89b0332d3861ce2d9b37c690a32c98e961d7e219 (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-x | update.php | 9 |
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; |