perf: reduce idle backend work

This commit is contained in:
Tunglies
2026-08-24 18:42:49 +08:00
parent eb6c81b00f
commit 9085d907cd
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -1067,7 +1067,7 @@ fn mark_service_unavailable_after_owner_loss<E: RunStateEnv>(store: &RunStateSto
}
/// How often the owner monitor samples Service status.
const OWNER_MONITOR_INTERVAL: Duration = Duration::from_secs(2);
const OWNER_MONITOR_INTERVAL: Duration = Duration::from_secs(5);
/// Mirrors `OwnerWatch`'s tolerance, for the log line only.
const SUSTAINED_OWNER_SAMPLES: u8 = 3;
+4 -1
View File
@@ -101,7 +101,10 @@ fn apply_status_item_attributed_title(status_item: &NSStatusItem, text: &NSStrin
let attrs = build_attributes(button.bounds().size.height);
let attrs: &NSDictionary<NSString, AnyObject> = &attrs;
let attr_str = create_attributed_string(text, Some(attrs));
status_item.setLength(status_item_length_for_speed(&attr_str));
let length = status_item_length_for_speed(&attr_str);
if status_item.length() != length {
status_item.setLength(length);
}
attr_str
} else {
create_attributed_string(text, None)
+1 -1
View File
@@ -67,7 +67,7 @@ export const AppDataProvider = ({
} = useQuery({
queryKey: ['getProxyView'],
queryFn: getProxyView,
refetchInterval: 3000,
refetchInterval: 15000,
refetchIntervalInBackground: false,
...TQ_MIHOMO,
})