mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
feat: replace fixed 50-entry cap with size-based feed trimming
Emails are now trimmed from the oldest end when total serialised size exceeds FEED_MAX_SIZE_BYTES (default 512 KB). Each EmailMetadata entry stores its size so future trims are computed without re-reading KV. Adds FEED_MAX_SIZE_BYTES, PROXY_TRUSTED_IPS and PROXY_AUTH_SECRET to Env. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,9 @@ export interface Env {
|
||||
EMAIL_STORAGE: KVNamespace;
|
||||
ADMIN_PASSWORD: string;
|
||||
DOMAIN: string;
|
||||
FEED_MAX_SIZE_BYTES?: string;
|
||||
PROXY_TRUSTED_IPS?: string;
|
||||
PROXY_AUTH_SECRET?: string;
|
||||
}
|
||||
|
||||
// Email interface for stored emails
|
||||
@@ -37,6 +40,7 @@ export interface EmailMetadata {
|
||||
key: string;
|
||||
subject: string;
|
||||
receivedAt: number;
|
||||
size?: number;
|
||||
}
|
||||
|
||||
// Feed list interface
|
||||
|
||||
Reference in New Issue
Block a user