Serve recent stages from SQLite with configurable background refresh
This commit is contained in:
@@ -248,6 +248,7 @@ SETTING_KEYS: List[str] = [
|
||||
"log_background_sync_level",
|
||||
"requests_sync_ttl_minutes",
|
||||
"requests_poll_interval_seconds",
|
||||
"requests_stage_refresh_minutes",
|
||||
"requests_delta_sync_interval_minutes",
|
||||
"requests_full_sync_time",
|
||||
"requests_cleanup_time",
|
||||
@@ -683,6 +684,14 @@ async def update_settings(payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
changed_keys.append(key)
|
||||
continue
|
||||
value_to_store = str(value).strip() if isinstance(value, str) else str(value)
|
||||
if key == "requests_stage_refresh_minutes":
|
||||
try:
|
||||
interval = int(value_to_store)
|
||||
except (TypeError, ValueError) as exc:
|
||||
raise HTTPException(status_code=400, detail="Local stage refresh must be a whole number from 1 to 1440 minutes") from exc
|
||||
if not 1 <= interval <= 1440:
|
||||
raise HTTPException(status_code=400, detail="Local stage refresh must be from 1 to 1440 minutes")
|
||||
value_to_store = str(interval)
|
||||
if key == "issue_confirmation_contact_attempts":
|
||||
try:
|
||||
attempts = int(value_to_store)
|
||||
|
||||
Reference in New Issue
Block a user