diff --git a/backend/windmill-api/src/embeddings.rs b/backend/windmill-api/src/embeddings.rs index 5cc7226753..fd222bdbfa 100644 --- a/backend/windmill-api/src/embeddings.rs +++ b/backend/windmill-api/src/embeddings.rs @@ -53,6 +53,7 @@ use crate::{resources::ResourceType, HTTP_CLIENT}; lazy_static::lazy_static! { pub static ref EMBEDDINGS_DB: Arc>> = Arc::new(RwLock::new(None)); pub static ref MODEL_INSTANCE: Arc>>> = Arc::new(RwLock::new(None)); + pub static ref HUB_EMBEDDINGS_PULLING_INTERVAL_SECS: u64 = std::env::var("HUB_EMBEDDINGS_PULLING_INTERVAL_SECS").ok().map(|x| x.parse::().ok()).flatten().unwrap_or(3600 * 24); } #[cfg(feature = "embedding")] @@ -607,7 +608,10 @@ pub fn load_embeddings_db(db: &Pool) -> () { drop(model_instance_lock); loop { update_embeddings_db(&db_clone).await; - tokio::time::sleep(std::time::Duration::from_secs(3600 * 24)).await; + tokio::time::sleep(std::time::Duration::from_secs( + *HUB_EMBEDDINGS_PULLING_INTERVAL_SECS, + )) + .await; } } else { tracing::error!(