Tune sxyprn app-client refresh interval to 15 minutes

App clients were refreshing (and thus swapping thumbnails) every 30
minutes, already more often than hourly. Lowered the app-client cache
TTL to 15 minutes in both fetch paths and matched the channel's
advisory cacheDuration.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QTqf6orbHZ9rFFpVpcgzcR
This commit is contained in:
Simon
2026-09-21 15:30:23 +00:00
parent c7ae89fc37
commit 1111906661

View File

@@ -106,7 +106,7 @@ impl SxyprnProvider {
}, },
], ],
nsfw: true, nsfw: true,
cacheDuration: Some(1800), cacheDuration: Some(900),
ytdlpCommand: Some("yt-dlp --impersonate chrome-120".to_string()) ytdlpCommand: Some("yt-dlp --impersonate chrome-120".to_string())
} }
} }
@@ -155,7 +155,7 @@ impl SxyprnProvider {
} else { } else {
url_str.clone() url_str.clone()
}; };
let cache_ttl_secs: u64 = if is_app_client { 30 * 60 } else { 60 * 60 }; let cache_ttl_secs: u64 = if is_app_client { 15 * 60 } else { 60 * 60 };
let old_items = match cache.get(&cache_key) { let old_items = match cache.get(&cache_key) {
Some((time, items)) => { Some((time, items)) => {
@@ -253,7 +253,7 @@ impl SxyprnProvider {
} else { } else {
url_str.clone() url_str.clone()
}; };
let cache_ttl_secs: u64 = if is_app_client { 30 * 60 } else { 60 * 60 }; let cache_ttl_secs: u64 = if is_app_client { 15 * 60 } else { 60 * 60 };
// Check our Video Cache. If the result is younger than the TTL, we return it. // Check our Video Cache. If the result is younger than the TTL, we return it.
let old_items = match cache.get(&cache_key) { let old_items = match cache.get(&cache_key) {
Some((time, items)) => { Some((time, items)) => {