mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-15 05:40:47 +08:00
perf: reduce idle backend work
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -67,7 +67,7 @@ export const AppDataProvider = ({
|
||||
} = useQuery({
|
||||
queryKey: ['getProxyView'],
|
||||
queryFn: getProxyView,
|
||||
refetchInterval: 3000,
|
||||
refetchInterval: 15000,
|
||||
refetchIntervalInBackground: false,
|
||||
...TQ_MIHOMO,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user