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

Function open_readonly_repository

atomic-cli/src/commands/mod.rs:368–372  ·  view source on GitHub ↗

Acquire a read-only repository for a CLI query, allowing short-lived writers (such as Stop checkpoint publication) to finish first. Only typed database contention is retried, for at most ten seconds; all other errors propagate immediately. Callers must not already hold a writable repository handle. Keep this policy at the CLI boundary: library callers may require immediate failure or supply their

(
    path: impl AsRef<Path>,
)

Source from the content-addressed store, hash-verified

366/// Keep this policy at the CLI boundary: library callers may require immediate
367/// failure or supply their own deadline to `Repository::open_readonly_wait`.
368pub(crate) fn open_readonly_repository(
369 path: impl AsRef<Path>,
370) -> Result<Repository, atomic_repository::RepositoryError> {
371 Repository::open_readonly_wait(path, std::time::Duration::from_secs(10))
372}
373
374/// Open a repository or return a user-friendly error.
375///

Callers 9

runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected