mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-13 06:02:08 +08:00
refactor: mihomo ipc (#6312)
* refactor: mihomo ipc * feat: enable tauri-plugin-mihomo log * chore: filter tauri ipc modules log * chore: update tauri-plugin-mihomo dep * chore: bump tauri-plugin-mihomo version to 0.1.6 --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
@@ -68,8 +68,7 @@ impl Logger {
|
||||
self.log_max_size.store(log_max_size, Ordering::SeqCst);
|
||||
self.log_max_count.store(log_max_count, Ordering::SeqCst);
|
||||
|
||||
#[cfg(not(feature = "tokio-trace"))]
|
||||
#[cfg(not(feature = "tauri-dev"))]
|
||||
#[cfg(not(any(feature = "tauri-dev", feature = "tokio-trace")))]
|
||||
{
|
||||
let log_spec = Self::generate_log_spec(log_level);
|
||||
let log_dir = dirs::app_logs_dir()?;
|
||||
@@ -89,9 +88,9 @@ impl Logger {
|
||||
|
||||
let mut filter_modules = vec!["wry", "tokio_tungstenite", "tungstenite"];
|
||||
#[cfg(not(feature = "tracing"))]
|
||||
filter_modules.push("tauri");
|
||||
filter_modules.push("tauri::ipc");
|
||||
#[cfg(feature = "tracing")]
|
||||
filter_modules.extend(["tauri_plugin_mihomo", "kode_bridge"]);
|
||||
filter_modules.extend(["kode_bridge"]);
|
||||
let logger = logger.filter(Box::new(clash_verge_logging::NoModuleFilter(filter_modules)));
|
||||
|
||||
let handle = logger.start()?;
|
||||
|
||||
@@ -23,7 +23,6 @@ use tauri::{AppHandle, Manager as _};
|
||||
#[cfg(target_os = "macos")]
|
||||
use tauri_plugin_autostart::MacosLauncher;
|
||||
use tauri_plugin_deep_link::DeepLinkExt as _;
|
||||
use tauri_plugin_mihomo::RejectPolicy;
|
||||
|
||||
pub static APP_HANDLE: OnceCell<AppHandle> = OnceCell::new();
|
||||
/// Application initialization helper functions
|
||||
@@ -58,15 +57,6 @@ mod app_init {
|
||||
tauri_plugin_mihomo::Builder::new()
|
||||
.protocol(tauri_plugin_mihomo::models::Protocol::LocalSocket)
|
||||
.socket_path(crate::config::IClashTemp::guard_external_controller_ipc())
|
||||
.pool_config(
|
||||
tauri_plugin_mihomo::IpcPoolConfigBuilder::new()
|
||||
.min_connections(3)
|
||||
.max_connections(32)
|
||||
.idle_timeout(std::time::Duration::from_secs(60))
|
||||
.health_check_interval(std::time::Duration::from_secs(60))
|
||||
.reject_policy(RejectPolicy::Wait)
|
||||
.build(),
|
||||
)
|
||||
.build(),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user