diff --git a/src/main_module/bootstrap.rs b/src/main_module/bootstrap.rs index 18f53f2e..70d12f0f 100644 --- a/src/main_module/bootstrap.rs +++ b/src/main_module/bootstrap.rs @@ -895,11 +895,8 @@ pub async fn start_background_services( #[cfg(feature = "drive")] start_drive_monitors(app_state.clone(), _pool).await; - // Local file monitoring removed - Drive (MinIO) is the only source now - // #[cfg(feature = "local-files")] - // start_local_file_monitor(app_state.clone()).await; - - // #[cfg(feature = "local-files")] + // Start LocalFileMonitor to compile .bas files from /opt/gbo/data to /opt/gbo/work + start_local_file_monitor(app_state.clone()).await; // start_config_watcher(app_state.clone()).await; } @@ -1132,23 +1129,23 @@ fn create_bot_from_drive( } -// // LocalFileMonitor and ConfigWatcher disabled - drive (MinIO) is the only source now -// async fn start_local_file_monitor(app_state: Arc) { -// use crate::drive::local_file_monitor::LocalFileMonitor; -// -// let monitor = LocalFileMonitor::new(app_state.clone()); -// if let Err(e) = monitor.start_monitoring().await { -// error!("Failed to start LocalFileMonitor: {}", e); -// } else { -// trace!("LocalFileMonitor started - monitoring /opt/gbo/data for bot changes"); -// } -// } -// +// LocalFileMonitor compiles .bas files from /opt/gbo/data to /opt/gbo/work +async fn start_local_file_monitor(app_state: Arc) { +use crate::drive::local_file_monitor::LocalFileMonitor; + +let monitor = LocalFileMonitor::new(app_state.clone()); +if let Err(e) = monitor.start_monitoring().await { +error!("Failed to start LocalFileMonitor: {}", e); +} else { +trace!("LocalFileMonitor started - monitoring /opt/gbo/data for bot changes"); +} +} +// // async fn start_config_watcher(app_state: Arc) { // use crate::core::config::watcher::ConfigWatcher; // use crate::core::shared::utils::get_work_path; // use std::sync::Arc as StdArc; -// +// // let data_dir = std::path::PathBuf::from(get_work_path()); // let watcher = ConfigWatcher::new(data_dir, app_state.clone()); // let _handle = StdArc::new(watcher).spawn();