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>,
)
| 409 | /// Keep this policy at the CLI boundary: library callers may require immediate |
| 410 | /// failure or supply their own deadline to `Repository::open_readonly_wait`. |
| 411 | pub(crate) fn open_readonly_repository( |
| 412 | path: impl AsRef<Path>, |
| 413 | ) -> Result<Repository, atomic_repository::RepositoryError> { |
| 414 | Repository::open_readonly_wait(path, std::time::Duration::from_secs(10)) |
| 415 | } |
| 416 | |
| 417 | /// Open the repository at `root` for a command that writes to the vault, |
| 418 | /// creating the vault when it does not exist yet. |