diff --git a/crates/worker-runtime/src/main.rs b/crates/worker-runtime/src/main.rs index 1f0f723c..0cf435b8 100644 --- a/crates/worker-runtime/src/main.rs +++ b/crates/worker-runtime/src/main.rs @@ -123,10 +123,16 @@ fn working_directory_runtime_root(config: &ProcessConfig) -> PathBuf { _ => config .worker_runtime_base_dir .clone() - .unwrap_or_else(|| env::temp_dir().join("yoi-worker-runtime")), + .unwrap_or_else(default_working_directory_runtime_root), } } +fn default_working_directory_runtime_root() -> PathBuf { + manifest::paths::data_dir() + .map(|data_dir| data_dir.join("worker-runtime")) + .unwrap_or_else(|| env::temp_dir().join("yoi-worker-runtime")) +} + fn runtime_options_from_http(config: &RuntimeHttpServerConfig) -> RuntimeOptions { RuntimeOptions { runtime_id: config.runtime_id.clone(),