chore(mobile-app): 调整维护状态轮询间隔为30-60秒

减少服务器压力:
- 将轮询间隔从 3-6 秒调整为 30-60 秒
- 10,000 用户时每秒约 222 次请求(之前约 2,222 次)
- 用户最多 60 秒内发现维护状态变化
- 启动时和从后台恢复时仍立即检查

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-28 06:23:20 -08:00
parent 7e8113805d
commit 68237d9905
1 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ class _HomeShellPageState extends ConsumerState<HomeShellPage>
}
}
/// 3-6
/// 30-60
void _startMaintenanceCheck() {
_scheduleNextMaintenanceCheck();
}
@ -89,8 +89,8 @@ class _HomeShellPageState extends ConsumerState<HomeShellPage>
///
void _scheduleNextMaintenanceCheck() {
_maintenanceCheckTimer?.cancel();
// 3-6
final randomSeconds = 3 + Random().nextInt(4); // 3 + 0~3 = 3~6
// 30-60
final randomSeconds = 30 + Random().nextInt(31); // 30 + 0~30 = 30~60
_maintenanceCheckTimer = Timer(Duration(seconds: randomSeconds), () async {
await _checkMaintenanceStatus();
//