pub fn optimize_max_age_for_startup(
last_startup: Option<&str>,
default_max_age: Option<u32>,
) -> Option<u32>Expand description
What: Calculate optimal max_age_days based on last startup timestamp.
Inputs:
last_startup: Optional timestamp inYYYYMMDD:HHMMSSformat.default_max_age: Default max age in days if no optimization applies.
Output:
- Optimized
max_age_daysvalue, orNoneto fetch all.
Details:
- If last startup was within 1 hour: use 1 day (recent data likely cached)
- If last startup was within 24 hours: use 2 days
- If last startup was within 7 days: use configured
max_ageor 7 days - Otherwise: use configured
max_age - This reduces unnecessary fetching when the app was recently used.
- NOTE: This only affects Arch news and advisories date filtering. Package updates are ALWAYS fetched fresh to detect new packages and version changes.