Utvider synops-calendar CLI med --url for å hente ICS fra eksterne URLer (Google Calendar, Outlook, etc). Ny calendar_poller i maskinrommet poller samlingers calendar_subscriptions[] med konfigurerbart intervall, etter samme mønster som feed_poller for RSS-feeds. Endringer: - synops-calendar: ny --url parameter + reqwest for HTTP-henting - calendar_poller.rs: bakgrunnsloop som finner forfalne abonnementer - calendar_poll jobbtype i dispatcher med CLI-dispatch til synops-calendar - API: configure_calendar_subscription + remove_calendar_subscription - Migrasjon 031: indeks + prioritetsregel for calendar_poll-jobber
30 lines
1.4 KiB
PL/PgSQL
30 lines
1.4 KiB
PL/PgSQL
-- 031_calendar_subscriptions.sql
|
|
-- Oppgave 29.12: CalDAV-abonnement — periodisk polling av eksterne kalendere.
|
|
-- Kalenderabonnementer lagres i samlingens metadata.calendar_subscriptions[],
|
|
-- etter samme mønster som feed_subscriptions (oppgave 29.3).
|
|
--
|
|
-- Inneholder:
|
|
-- 1. Indeks for rask oppslag av calendar_subscriptions
|
|
-- 2. Prioritetsregel for calendar_poll-jobber
|
|
--
|
|
-- Ref: docs/features/kalender.md, tools/synops-calendar/
|
|
|
|
BEGIN;
|
|
|
|
-- =============================================================================
|
|
-- 1. Indeks for rask oppslag av samlinger med calendar_subscriptions
|
|
-- =============================================================================
|
|
CREATE INDEX IF NOT EXISTS idx_nodes_calendar_subscriptions
|
|
ON nodes ((metadata->'calendar_subscriptions'))
|
|
WHERE node_kind = 'collection' AND metadata ? 'calendar_subscriptions';
|
|
|
|
-- =============================================================================
|
|
-- 2. Prioritetsregel for calendar_poll-jobber
|
|
-- =============================================================================
|
|
-- Lav prioritet (3), lav CPU-vekt, maks 2 samtidige, 120s timeout.
|
|
-- Kalender-polling er bakgrunnsarbeid som ikke haster.
|
|
INSERT INTO job_priority_rules (job_type, base_priority, cpu_weight, max_concurrent, timeout_seconds)
|
|
VALUES ('calendar_poll', 3, 1, 2, 120)
|
|
ON CONFLICT (job_type) DO NOTHING;
|
|
|
|
COMMIT;
|