fix(snix/castore,snix/store): Create parent directory when creating redb services
Change-Id: I0b3083cbbb865d4b724d2b30305c10f2a779bce4 Reviewed-on: https://cl.snix.dev/c/snix/+/30646 Tested-by: besadii Reviewed-by: Florian Klink <flokli@flokli.de>
This commit is contained in:
parent
05a9715a20
commit
8e609804b9
2 changed files with 8 additions and 0 deletions
|
|
@ -36,6 +36,10 @@ impl RedbDirectoryService {
|
|||
));
|
||||
}
|
||||
|
||||
if let Some(parent) = path.parent() {
|
||||
std::fs::create_dir_all(parent)?;
|
||||
}
|
||||
|
||||
let db = tokio::task::spawn_blocking(|| -> Result<_, redb::Error> {
|
||||
let db = redb::Database::create(path)?;
|
||||
create_schema(&db)?;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,10 @@ impl RedbPathInfoService {
|
|||
));
|
||||
}
|
||||
|
||||
if let Some(parent) = path.parent() {
|
||||
std::fs::create_dir_all(parent)?;
|
||||
}
|
||||
|
||||
let db = tokio::task::spawn_blocking(|| -> Result<_, redb::Error> {
|
||||
let db = redb::Database::create(path)?;
|
||||
create_schema(&db)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue