aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-09-06 21:41:17 +0200
committerGravatar GitHub <noreply@github.com> 2023-09-06 21:41:17 +0200
commit98559cebc367648195080c1588ea197607c216f7 (patch)
tree512be791adab5d1c9a82a775494b89f2da75e09f
parent2e1d45a88d2cfd439f4f9e7d92ca9c8cbdb39466 (diff)
Remove obsolete TTL migration code (#5625)
Remove `updateTTL` function used to help migration to 5+ year-old FreshRSS 1.10 and FreshRSS 0.7.3 https://github.com/FreshRSS/FreshRSS/pull/1750 This function contributed to locking the database https://github.com/FreshRSS/FreshRSS/pull/5574 Subset of https://github.com/FreshRSS/FreshRSS/pull/3558
-rw-r--r--app/Controllers/statsController.php3
-rw-r--r--app/Controllers/subscriptionController.php3
-rw-r--r--app/Models/FeedDAO.php19
3 files changed, 0 insertions, 25 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index 9890db04b..bb99bc601 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -32,10 +32,7 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
]);
$catDAO = FreshRSS_Factory::createCategoryDao();
- $feedDAO = FreshRSS_Factory::createFeedDao();
-
$catDAO->checkDefault();
- $feedDAO->updateTTL();
$this->view->categories = $catDAO->listSortedCategories(false) ?: [];
$this->view->default_category = $catDAO->getDefault();
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index 733a9252c..86083ceb0 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -15,10 +15,7 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
}
$catDAO = FreshRSS_Factory::createCategoryDao();
- $feedDAO = FreshRSS_Factory::createFeedDao();
-
$catDAO->checkDefault();
- $feedDAO->updateTTL();
$this->view->categories = $catDAO->listSortedCategories(false, true) ?: [];
$this->view->default_category = $catDAO->getDefault();
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index dc3a33165..5461ba4ed 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -374,7 +374,6 @@ SQL;
* @return array<FreshRSS_Feed>
*/
public function listFeedsOrderUpdate(int $defaultCacheDuration = 3600, int $limit = 0): array {
- $this->updateTTL();
$sql = 'SELECT id, url, kind, name, website, `lastUpdate`, `pathEntries`, `httpAuth`, ttl, attributes '
. 'FROM `_feed` '
. ($defaultCacheDuration < 0 ? '' : 'WHERE ttl >= ' . FreshRSS_Feed::TTL_DEFAULT
@@ -622,24 +621,6 @@ SQL;
return $list;
}
- public function updateTTL(): void {
- $sql = 'UPDATE `_feed` SET ttl=:new_value WHERE ttl=:old_value';
- $stm = $this->pdo->prepare($sql);
- if (!($stm && $stm->execute([':new_value' => FreshRSS_Feed::TTL_DEFAULT, ':old_value' => -2]))) {
- $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo();
- Minz_Log::error('SQL error ' . __METHOD__ . ' A ' . json_encode($info));
-
- $sql2 = 'ALTER TABLE `_feed` ADD COLUMN ttl INT NOT NULL DEFAULT ' . FreshRSS_Feed::TTL_DEFAULT; //v0.7.3
- $stm = $this->pdo->query($sql2);
- if ($stm === false) {
- $info = $this->pdo->errorInfo();
- Minz_Log::error('SQL error ' . __METHOD__ . ' B ' . json_encode($info));
- }
- } else {
- $stm->execute([':new_value' => -3600, ':old_value' => -1]);
- }
- }
-
public function count(): int {
$sql = 'SELECT COUNT(e.id) AS count FROM `_feed` e';
$stm = $this->pdo->query($sql);