From f9b8e817e6a7e2947b314c395ed890e85ffcd3b6 Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 16 Jul 2023 10:02:05 -0500 Subject: [PATCH] Drain joinset before completing migration --- src/migrate_store.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/migrate_store.rs b/src/migrate_store.rs index e606287..84a92b5 100644 --- a/src/migrate_store.rs +++ b/src/migrate_store.rs @@ -126,6 +126,10 @@ where joinset.spawn_local(async move { migrate_hash(&state, hash).await }); } + while let Some(res) = joinset.join_next().await { + res.map_err(|_| UploadError::Canceled)??; + } + // clean up the migration table to avoid interfering with future migrations repo.clear().await?;