From cb00405041ee4714b6e817e9570cfa10ae972840 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Mon, 27 Apr 2026 21:20:10 +0900
Subject: feat(backend): adapt feed fetch interval to update frequency

Add per-feed fetch_interval_seconds (clamped to [1h, 24h]) that halves
on new articles and grows 1.5x when a fetch yields nothing, replacing
the fixed 1h schedule with the 10min cooldown filter. Scheduler tick
shortened to 30min so the 1h floor is honored with reasonable precision.
---
 backend/db/schema.sql | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'backend/db/schema.sql')

diff --git a/backend/db/schema.sql b/backend/db/schema.sql
index 2596c84..85f39d1 100644
--- a/backend/db/schema.sql
+++ b/backend/db/schema.sql
@@ -8,12 +8,13 @@ CREATE TABLE IF NOT EXISTS users (
 
 -- Feeds
 CREATE TABLE IF NOT EXISTS feeds (
-    id            INTEGER PRIMARY KEY AUTOINCREMENT,
-    url           TEXT NOT NULL,
-    title         TEXT NOT NULL,
-    fetched_at    TEXT NOT NULL,
-    is_subscribed INTEGER NOT NULL DEFAULT 1,
-    user_id       INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE
+    id                     INTEGER PRIMARY KEY AUTOINCREMENT,
+    url                    TEXT NOT NULL,
+    title                  TEXT NOT NULL,
+    fetched_at             TEXT NOT NULL,
+    is_subscribed          INTEGER NOT NULL DEFAULT 1,
+    user_id                INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+    fetch_interval_seconds INTEGER NOT NULL DEFAULT 3600
 );
 
 -- Articles
-- 
cgit v1.3.1

