Compare commits

..

2 Commits

Author SHA1 Message Date
spinline
bb32c1f7f6 fix: improve push notification reliability by removing invalid subscriptions and update rTorrent webhook logging
All checks were successful
Build MIPS Binary / build (push) Successful in 1m50s
2026-02-13 12:31:06 +03:00
spinline
3bb2d68a65 perf: increase background polling interval to 60 seconds
All checks were successful
Build MIPS Binary / build (push) Successful in 1m51s
2026-02-13 12:26:09 +03:00
2 changed files with 14 additions and 2 deletions

View File

@@ -314,7 +314,7 @@ async fn main() {
let loop_interval = if active_clients > 0 {
Duration::from_secs(1)
} else {
Duration::from_secs(30)
Duration::from_secs(60)
};
// 1. Fetch Torrents

View File

@@ -192,10 +192,22 @@ pub async fn send_push_notification(
}
Err(e) => {
tracing::error!("Failed to send push notification to {}: {}", subscription.endpoint, e);
// If subscription is invalid/expired (Gone or Unauthorized), remove it
if format!("{:?}", e).contains("Unauthorized") || format!("{:?}", e).contains("Gone") {
tracing::info!("Removing invalid subscription: {}", subscription.endpoint);
let _ = store.remove_subscription(&subscription.endpoint).await;
}
}
}
}
Err(e) => tracing::error!("Failed to build push message: {}", e),
Err(e) => {
tracing::error!("Failed to build push message: {}", e);
// Specific handling for encryption errors - often means invalid keys
if format!("{:?}", e).contains("encrypting") {
tracing::warn!("Encryption error for subscriber {}, removing suspect subscription", subscription.endpoint);
let _ = store.remove_subscription(&subscription.endpoint).await;
}
}
}
}
Err(e) => tracing::error!("Failed to build VAPID signature: {}", e),