MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / database_lock_wait

Function database_lock_wait

atomic-repository/src/repository/database.rs:45–53  ·  view source on GitHub ↗

Budget for opening a repository database (or the change store inside it) when another process may hold the writer lock. Every hook invocation is a separate process, so cross-process coordination waits on a bounded budget rather than failing the open: short-lived writers (a recording agent turn, a gated daemon mutation) finish first, and the contested open then succeeds. Waiting longer is always s

()

Source from the content-addressed store, hash-verified

43///
44/// Override with `ATOMIC_DB_LOCK_WAIT_MS`.
45pub fn database_lock_wait() -> std::time::Duration {
46 std::env::var("ATOMIC_DB_LOCK_WAIT_MS")
47 .ok()
48 .and_then(|raw| raw.parse::<u64>().ok())
49 .map_or(
50 std::time::Duration::from_secs(30),
51 std::time::Duration::from_millis,
52 )
53}
54
55/// Whether `dot_dir` holds a repository database in either layout.
56pub fn has_database(dot_dir: &Path) -> bool {

Callers 11

finish_service_addFunction · 0.85
view_listFunction · 0.85
render_service_statusMethod · 0.85
prepare_service_queryFunction · 0.85
finish_service_switchFunction · 0.85
runMethod · 0.85
database_waitFunction · 0.85
database_open_waitFunction · 0.85

Calls 1

okMethod · 0.45