mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-30 20:04:47 +00:00
create before canonicalize
This commit is contained in:
@@ -200,6 +200,9 @@ pub struct Store {
|
|||||||
}
|
}
|
||||||
impl Store {
|
impl Store {
|
||||||
pub async fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
|
pub async fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error> {
|
||||||
|
if !path.as_ref().exists() {
|
||||||
|
tokio::fs::File::create(path.as_ref()).await?;
|
||||||
|
}
|
||||||
let path = tokio::fs::canonicalize(path).await?;
|
let path = tokio::fs::canonicalize(path).await?;
|
||||||
let _lock = {
|
let _lock = {
|
||||||
let mut lock = OPEN_STORES.lock().await;
|
let mut lock = OPEN_STORES.lock().await;
|
||||||
|
|||||||
Reference in New Issue
Block a user