Centralize ZED_STATELESS (#37492)
Closes #ISSUE Centralizes the references to the `ZED_STATELESS` env var into a single location in a new crate named `zed_env_vars` Release Notes: - N/A *or* Added/Fixed/Improved ...
This commit is contained in:
+2
-4
@@ -17,9 +17,10 @@ use sqlez::thread_safe_connection::ThreadSafeConnection;
|
||||
use sqlez_macros::sql;
|
||||
use std::future::Future;
|
||||
use std::path::Path;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
use std::sync::{LazyLock, atomic::Ordering};
|
||||
use std::{env, sync::atomic::AtomicBool};
|
||||
use util::{ResultExt, maybe};
|
||||
use zed_env_vars::ZED_STATELESS;
|
||||
|
||||
const CONNECTION_INITIALIZE_QUERY: &str = sql!(
|
||||
PRAGMA foreign_keys=TRUE;
|
||||
@@ -36,9 +37,6 @@ const FALLBACK_DB_NAME: &str = "FALLBACK_MEMORY_DB";
|
||||
|
||||
const DB_FILE_NAME: &str = "db.sqlite";
|
||||
|
||||
pub static ZED_STATELESS: LazyLock<bool> =
|
||||
LazyLock::new(|| env::var("ZED_STATELESS").is_ok_and(|v| !v.is_empty()));
|
||||
|
||||
pub static ALL_FILE_DB_FAILED: LazyLock<AtomicBool> = LazyLock::new(|| AtomicBool::new(false));
|
||||
|
||||
/// Open or create a database at the given directory path.
|
||||
|
||||
Reference in New Issue
Block a user