mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 10:21:53 +00:00
create before canonicalize
This commit is contained in:
@@ -200,6 +200,9 @@ pub struct Store {
|
||||
}
|
||||
impl Store {
|
||||
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 _lock = {
|
||||
let mut lock = OPEN_STORES.lock().await;
|
||||
|
||||
Reference in New Issue
Block a user