Skip to content

Commit 0781316

Browse files
authored
Merge pull request #2040 from deltachat/workaround-spawned-tasks
workaround executer-blocking-handling bug
2 parents e6b7a7e + 8eb73a5 commit 0781316

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/blob.rs

+10
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ impl<'a> BlobObject<'a> {
6363
blobname: name.clone(),
6464
cause: err.into(),
6565
})?;
66+
67+
// workaround a bug in async-std
68+
// (the executor does not handle blocking operation in Drop correctly,
69+
// see https://github.com/async-rs/async-std/issues/900 )
70+
let _ = file.flush().await;
71+
6672
let blob = BlobObject {
6773
blobdir,
6874
name: format!("$BLOBDIR/{}", name),
@@ -151,6 +157,10 @@ impl<'a> BlobObject<'a> {
151157
cause: err,
152158
});
153159
}
160+
161+
// workaround, see create() for details
162+
let _ = dst_file.flush().await;
163+
154164
let blob = BlobObject {
155165
blobdir: context.get_blobdir(),
156166
name: format!("$BLOBDIR/{}", name),

0 commit comments

Comments
 (0)