Run stats and consent-log retention purges off the request

The daily purge was awaited inside the visitor's request via payload.delete,
which loads and deletes expired documents one by one. It now runs as one
db.deleteMany in the background; failures are logged and retried.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-22 17:04:09 +02:00
co-authored by Claude Opus 5.5
parent 78f4f5c16b
commit 0bfc509102
6 changed files with 109 additions and 21 deletions
+1 -1
View File
@@ -305,7 +305,7 @@ chcesz zachować sprzątanie locale (albo zaimportuj `LOCALE_COOKIE_NAME` i doda
- **Rejestr zgód (dowód zgody, art. 7 ust. 1 RODO):** `ipalKit({ consentLog: true })` +
`<ConsentProvider logEndpoint="/api/ipal/consent">`. Zapisuje losowy identyfikator (ten sam co w
ciasteczku), wybory, wersję polityki i czas — **bez IP i user-agenta**. Kolekcja *Consent records*
(tylko admin), automatyczne czyszczenie po `retentionDays` (domyślnie 1095). Postgres: `migrate:create`.
(tylko admin), automatyczne czyszczenie po `retentionDays` (domyślnie 1095; raz na dobę, w tle — zapis zgody na nie nie czeka). Postgres: `migrate:create`.
- **Tabela ciasteczek** dla strony polityki: Cookie Settings → *Cookies* (wypełniana skanem,
skill `ipal-consent-check` → cookie-scan) + `getCookieTable` + `<CookieTable>` z `/rsc`.
- Ciasteczko zgody ma `Secure` na HTTPS.