feat(extension-health): lengthen cache TTL and honor per-check minimum

Raise default extension health cache to 10 minutes with a 1-minute floor
and a shorter TTL for unknown status. Mirror the TTL rules in the Go
backend and stop force-refreshing health checks from the download
service picker on every open.
This commit is contained in:
zarzet
2026-06-30 06:20:10 +07:00
parent d882fc292c
commit dc8bb2cbc2
3 changed files with 41 additions and 11 deletions
+2 -6
View File
@@ -75,9 +75,7 @@ class _DownloadServicePickerState extends ConsumerState<DownloadServicePicker> {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) return;
ref
.read(extensionProvider.notifier)
.refreshEnabledExtensionHealth(force: true);
ref.read(extensionProvider.notifier).refreshEnabledExtensionHealth();
});
final downloadExtensions = _downloadExtensions();
final recommended = widget.recommendedService;
@@ -109,9 +107,7 @@ class _DownloadServicePickerState extends ConsumerState<DownloadServicePicker> {
setState(() => _selectedService = extension.id);
if (extension.hasServiceHealth) {
unawaited(
ref
.read(extensionProvider.notifier)
.checkExtensionHealth(extension.id, force: true),
ref.read(extensionProvider.notifier).checkExtensionHealth(extension.id),
);
}
}