fix: scan status=unregistered not shown as registered; feat: config API for auto-pipeline/watcher-auto-register
This commit is contained in:
@@ -19,6 +19,32 @@ pub fn set_cache_enabled(enabled: bool) {
|
||||
tracing::info!("Cache enabled set to: {}", enabled);
|
||||
}
|
||||
|
||||
// Switch 1: watcher detects new file → auto-register
|
||||
pub static RUNTIME_WATCHER_AUTO_REGISTER: Lazy<RwLock<bool>> =
|
||||
Lazy::new(|| RwLock::new(false));
|
||||
|
||||
pub fn get_watcher_auto_register() -> bool {
|
||||
*RUNTIME_WATCHER_AUTO_REGISTER.read().unwrap()
|
||||
}
|
||||
|
||||
pub fn set_watcher_auto_register(enabled: bool) {
|
||||
*RUNTIME_WATCHER_AUTO_REGISTER.write().unwrap() = enabled;
|
||||
tracing::info!("Watcher auto-register set to: {}", enabled);
|
||||
}
|
||||
|
||||
// Switch 2: register → auto-trigger processing pipeline
|
||||
pub static RUNTIME_AUTO_PIPELINE_ENABLED: Lazy<RwLock<bool>> =
|
||||
Lazy::new(|| RwLock::new(false));
|
||||
|
||||
pub fn get_auto_pipeline_enabled() -> bool {
|
||||
*RUNTIME_AUTO_PIPELINE_ENABLED.read().unwrap()
|
||||
}
|
||||
|
||||
pub fn set_auto_pipeline_enabled(enabled: bool) {
|
||||
*RUNTIME_AUTO_PIPELINE_ENABLED.write().unwrap() = enabled;
|
||||
tracing::info!("Auto-pipeline enabled set to: {}", enabled);
|
||||
}
|
||||
|
||||
pub static DATABASE_URL: Lazy<String> = Lazy::new(|| {
|
||||
env::var("DATABASE_URL")
|
||||
.unwrap_or_else(|_| "postgres://accusys@localhost:5432/momentry".to_string())
|
||||
|
||||
Reference in New Issue
Block a user