Skip to content

Commit

Permalink
chore: remove local ai watch on windows and linux (AppFlowy-IO#6704)
Browse files Browse the repository at this point in the history
* chore: remove local ai watch on windows and linux

* chore: clippy
  • Loading branch information
appflowy authored and LucasXu0 committed Nov 4, 2024
1 parent bb965ce commit 28fda0e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
7 changes: 3 additions & 4 deletions frontend/rust-lib/flowy-ai/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ edition = "2021"
flowy-derive.workspace = true
flowy-notification = { workspace = true }
flowy-error = { path = "../flowy-error", features = [
"impl_from_dispatch_error",
"impl_from_collab_folder",
"impl_from_sqlite",
"impl_from_dispatch_error",
"impl_from_collab_folder",
"impl_from_sqlite",
] }
lib-dispatch = { workspace = true }
tracing.workspace = true
Expand Down Expand Up @@ -62,4 +62,3 @@ flowy-codegen.workspace = true
dart = ["flowy-codegen/dart", "flowy-notification/dart"]
tauri_ts = ["flowy-codegen/ts", "flowy-notification/tauri_ts"]
web_ts = ["flowy-codegen/ts", "flowy-notification/web_ts"]

10 changes: 5 additions & 5 deletions frontend/rust-lib/flowy-ai/src/local_ai/local_llm_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::path::PathBuf;
use std::sync::Arc;

use crate::local_ai::watch::offline_app_path;
#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
#[cfg(target_os = "macos")]
use crate::local_ai::watch::{watch_offline_app, WatchContext};
use tokio::fs::{self};
use tokio_util::sync::CancellationToken;
Expand Down Expand Up @@ -70,7 +70,7 @@ pub struct LocalAIResourceController {
ai_config: ArcSwapOption<LocalAIConfig>,
download_task: Arc<ArcSwapOption<DownloadTask>>,
resource_notify: tokio::sync::mpsc::Sender<()>,
#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
#[cfg(target_os = "macos")]
#[allow(dead_code)]
offline_app_disk_watch: Option<WatchContext>,
offline_app_state_sender: tokio::sync::broadcast::Sender<WatchDiskEvent>,
Expand All @@ -84,10 +84,10 @@ impl LocalAIResourceController {
) -> Self {
let (offline_app_state_sender, _) = tokio::sync::broadcast::channel(1);
let llm_setting = resource_service.retrieve_setting().map(Arc::new);
#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
#[cfg(target_os = "macos")]
let mut offline_app_disk_watch: Option<WatchContext> = None;

#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
#[cfg(target_os = "macos")]
{
match watch_offline_app() {
Ok((new_watcher, mut rx)) => {
Expand All @@ -114,7 +114,7 @@ impl LocalAIResourceController {
ai_config: Default::default(),
download_task: Default::default(),
resource_notify,
#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
#[cfg(target_os = "macos")]
offline_app_disk_watch,
offline_app_state_sender,
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/rust-lib/flowy-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ collab-entity = { workspace = true }
collab-plugins = { workspace = true }
collab-folder = { workspace = true }

collab = { workspace = true }
#collab = { workspace = true, features = ["verbose_log"] }
#collab = { workspace = true }
collab = { workspace = true, features = ["verbose_log"] }

diesel.workspace = true
uuid.workspace = true
Expand Down

0 comments on commit 28fda0e

Please sign in to comment.