Optimize repeat healthcheck

This commit is contained in:
chen08209
2024-05-06 16:57:53 +08:00
parent 78081a12e8
commit 9f89fe8b29
8 changed files with 26 additions and 8 deletions

View File

@@ -38,14 +38,12 @@ class _ClashMessageContainerState extends State<ClashMessageContainer>
@override
void onDelay(Delay delay) {
globalState.healthcheckLock = true;
context.appController.setDelay(delay);
WidgetsBinding.instance.addPostFrameCallback((_) {
globalState.updateSortNumDebounce ??= debounce<Function()>(
() {
context.appController.updateGroups();
context.appController.appState.sortNum++;
globalState.healthcheckLock = false;
},
milliseconds: 5000,
);