feat: inactivity watchdog for sockets

This commit is contained in:
cogwheel0
2025-09-07 23:17:26 +05:30
parent a850a567a1
commit 30f1650faf
3 changed files with 242 additions and 110 deletions

View File

@@ -333,7 +333,9 @@ class PersistentStreamingService with WidgetsBindingObserver {
final lastUpdate = metadata['lastUpdate'] as DateTime?;
if (lastUpdate != null) {
final timeSinceUpdate = DateTime.now().difference(lastUpdate);
return timeSinceUpdate > const Duration(minutes: 1);
// Align with app-side watchdogs: be less aggressive than UI guard
// but still attempt recovery before server timeouts become likely.
return timeSinceUpdate > const Duration(minutes: 2);
}
return false;