Private
Public Access
Make the feed-poll interval site-wide instead of per-feed
Replaces Feed.fetch_interval_minutes with a single admin-editable SiteSettings.fetch_interval_minutes (apps.core), following the same singleton-row pattern as accounts.SetupLock. Per-feed error backoff is unchanged — only the configured baseline interval is now shared across every feed, loaded once per poll_due_feeds run rather than queried per feed. EVECTION_MIN_FETCH_INTERVAL_MINUTES keeps working as the floor underneath it. SiteSettings is registered in Django admin as a singleton: "Add" is only offered when no row exists yet, and delete is always refused. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a1ea2e5662
commit
dc8b9ff83b
11 files changed
+203
-20
No files matched your search
+18
-1
@@ -1 +1,18 @@
|
||||
# Register your models here.
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import SiteSettings
|
||||
|
||||
|
||||
@admin.register(SiteSettings)
|
||||
class SiteSettingsAdmin(admin.ModelAdmin):
|
||||
list_display = ["fetch_interval_minutes"]
|
||||
fields = ["fetch_interval_minutes"]
|
||||
|
||||
def has_add_permission(self, request):
|
||||
# Singleton — only offer "Add" when the row doesn't exist yet
|
||||
# (a fresh install before the first poll_due_feeds run or admin
|
||||
# visit has created it via SiteSettings.load()).
|
||||
return not SiteSettings.objects.exists()
|
||||
|
||||
def has_delete_permission(self, request, obj=None):
|
||||
return False
|
||||
Reference in new issue
Block a user