async file io

This commit is contained in:
dignifiedquire
2020-03-14 16:26:15 +01:00
parent 6db253e1cc
commit 7140898db9
19 changed files with 340 additions and 252 deletions

View File

@@ -96,7 +96,7 @@ impl Sql {
}
// return true on success, false on failure
pub async fn open(&self, context: &Context, dbfile: &Path, readonly: bool) -> bool {
pub async fn open<T: AsRef<Path>>(&self, context: &Context, dbfile: T, readonly: bool) -> bool {
match open(context, self, dbfile, readonly).await {
Ok(_) => true,
Err(crate::error::Error::SqlError(Error::SqlAlreadyOpen)) => false,
@@ -607,7 +607,7 @@ pub async fn housekeeping(context: &Context) {
entry.file_name()
);
let path = entry.path();
dc_delete_file(context, path);
dc_delete_file(context, path).await;
}
}
Err(err) => {