diff --git a/backend/src/ingestion/poller.ts b/backend/src/ingestion/poller.ts index b7475dc..f751b32 100644 --- a/backend/src/ingestion/poller.ts +++ b/backend/src/ingestion/poller.ts @@ -22,8 +22,8 @@ const adapters: Record = { // as opposed to Telegram where the message itself *is* the content. const FOLLOWS_LINK_FOR_FULL_ARTICLE: Source['type'][] = ['rss', 'api']; -export async function pollDueSources(defaultIntervalMinutes: number): Promise { - const due = sourcesDb.sourcesDueForPoll(defaultIntervalMinutes); +export async function pollDueSources(): Promise { + const due = sourcesDb.sourcesDueForPoll(); let ingested = 0; for (const source of due) { ingested += await pollOne(source); diff --git a/backend/src/queue/scheduler.ts b/backend/src/queue/scheduler.ts index b9d958c..39d9f56 100644 --- a/backend/src/queue/scheduler.ts +++ b/backend/src/queue/scheduler.ts @@ -24,8 +24,7 @@ export function startScheduler() { setInterval(async () => { try { - const settings = settingsDb.getSettings(); - const ingested = await pollDueSources(settings.defaultPollIntervalMinutes); + const ingested = await pollDueSources(); if (ingested > 0) logger.info('scheduler', `Poll tick: ingested ${ingested} new item(s)`); } catch (err) { logger.error('scheduler', `Poll tick failed: ${(err as Error).message}`); diff --git a/backend/src/storage/db/index.ts b/backend/src/storage/db/index.ts index 449d020..364981a 100644 --- a/backend/src/storage/db/index.ts +++ b/backend/src/storage/db/index.ts @@ -168,7 +168,6 @@ export function migrate() { CREATE TABLE IF NOT EXISTS global_settings ( id INTEGER PRIMARY KEY CHECK (id = 1), -- singleton row merge_strictness INTEGER NOT NULL DEFAULT 3, - default_poll_interval_minutes INTEGER NOT NULL DEFAULT 15, hold_before_publish_minutes INTEGER NOT NULL DEFAULT 30, tag_dedup_threshold REAL NOT NULL DEFAULT 0.82, tag_expiry_days INTEGER NOT NULL DEFAULT 21, diff --git a/backend/src/storage/db/settings.ts b/backend/src/storage/db/settings.ts index d734acd..a7a4b92 100644 --- a/backend/src/storage/db/settings.ts +++ b/backend/src/storage/db/settings.ts @@ -4,7 +4,6 @@ import type { GlobalSettings } from './types.js'; function rowToSettings(row: any): GlobalSettings { return { mergeStrictness: row.merge_strictness, - defaultPollIntervalMinutes: row.default_poll_interval_minutes, holdBeforePublishMinutes: row.hold_before_publish_minutes, tagDedupThreshold: row.tag_dedup_threshold, tagExpiryDays: row.tag_expiry_days, @@ -72,7 +71,7 @@ export function updateSettings(patch: Partial): GlobalSettings { // out of sync — node:sqlite binds each by its `$name` key, not position. db.prepare( `UPDATE global_settings SET - merge_strictness=$merge_strictness, default_poll_interval_minutes=$default_poll_interval_minutes, + merge_strictness=$merge_strictness, hold_before_publish_minutes=$hold_before_publish_minutes, tag_dedup_threshold=$tag_dedup_threshold, tag_expiry_days=$tag_expiry_days, follow_up_min_hours_since_last=$follow_up_min_hours_since_last, follow_up_min_new_sources=$follow_up_min_new_sources, @@ -90,7 +89,6 @@ export function updateSettings(patch: Partial): GlobalSettings { WHERE id = 1` ).run({ $merge_strictness: merged.mergeStrictness, - $default_poll_interval_minutes: merged.defaultPollIntervalMinutes, $hold_before_publish_minutes: merged.holdBeforePublishMinutes, $tag_dedup_threshold: merged.tagDedupThreshold, $tag_expiry_days: merged.tagExpiryDays, diff --git a/backend/src/storage/db/sources.ts b/backend/src/storage/db/sources.ts index ea6992e..8d89a8e 100644 --- a/backend/src/storage/db/sources.ts +++ b/backend/src/storage/db/sources.ts @@ -89,12 +89,11 @@ export function markPolled(id: string, error: string | null) { ); } -/** Sources due for polling right now, based on their own interval (or the global default). */ -export function sourcesDueForPoll(defaultIntervalMinutes: number): Source[] { +/** Sources due for polling right now, based on their own interval. */ +export function sourcesDueForPoll(): Source[] { const now = Date.now(); return listEnabledSources().filter((s) => { if (!s.lastPolledAt) return true; - const interval = (s.pollIntervalMinutes || defaultIntervalMinutes) * 60_000; - return now - new Date(s.lastPolledAt).getTime() >= interval; + return now - new Date(s.lastPolledAt).getTime() >= s.pollIntervalMinutes * 60_000; }); } diff --git a/backend/src/storage/db/types.ts b/backend/src/storage/db/types.ts index 9feb5f2..322d9d8 100644 --- a/backend/src/storage/db/types.ts +++ b/backend/src/storage/db/types.ts @@ -265,7 +265,6 @@ export interface Bookmark { export interface GlobalSettings { mergeStrictness: 1 | 2 | 3 | 4 | 5; - defaultPollIntervalMinutes: number; holdBeforePublishMinutes: number; tagDedupThreshold: number; tagExpiryDays: number; diff --git a/frontend/src/lib/adminTypes.ts b/frontend/src/lib/adminTypes.ts index 2795d58..9714f50 100644 --- a/frontend/src/lib/adminTypes.ts +++ b/frontend/src/lib/adminTypes.ts @@ -127,7 +127,6 @@ export interface AdminWidgetsEnabled { export interface AdminSettings { mergeStrictness: 1 | 2 | 3 | 4 | 5; - defaultPollIntervalMinutes: number; holdBeforePublishMinutes: number; tagDedupThreshold: number; tagExpiryDays: number; diff --git a/frontend/src/lib/components/admin/MergeTab.svelte b/frontend/src/lib/components/admin/MergeTab.svelte index d34d6d1..8e0ced1 100644 --- a/frontend/src/lib/components/admin/MergeTab.svelte +++ b/frontend/src/lib/components/admin/MergeTab.svelte @@ -28,7 +28,6 @@ try { await updateSettings({ mergeStrictness: local.mergeStrictness, - defaultPollIntervalMinutes: local.defaultPollIntervalMinutes, holdBeforePublishMinutes: local.holdBeforePublishMinutes, followUpMinHoursSinceLast: local.followUpMinHoursSinceLast, followUpMinNewSources: local.followUpMinNewSources, @@ -183,29 +182,14 @@ -
-
- Poll interval -

- Fallback only — every source above sets its own poll interval, so this value has no - effect unless a source somehow has none set (not currently possible through this admin - panel or the API). -

- -
-
- Hold before publish -

Wait window to gather more sources before finalizing a story.

- -
+
+ Hold before publish +

Wait window to gather more sources before finalizing a story.

+
diff --git a/mock-backend/admin-data.js b/mock-backend/admin-data.js index 5c91508..5191679 100644 --- a/mock-backend/admin-data.js +++ b/mock-backend/admin-data.js @@ -3,7 +3,6 @@ let settings = { mergeStrictness: 3, - defaultPollIntervalMinutes: 15, holdBeforePublishMinutes: 30, tagDedupThreshold: 0.82, tagExpiryDays: 21,