aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-02 23:14:10 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-02 23:14:10 +0200
commitc439cb11a908ee5405ed0a3a721e9c8c0e299ad2 (patch)
tree65835f8c9b47d0670d1461fc43f358fc73850414 /src/model
parent364061453cd0a5a2e4f76f4194e6b5887aae7ed8 (diff)
downloadgarage-c439cb11a908ee5405ed0a3a721e9c8c0e299ad2.tar.gz
garage-c439cb11a908ee5405ed0a3a721e9c8c0e299ad2.zip
Sqlite iter with unsafe code
Diffstat (limited to 'src/model')
-rw-r--r--src/model/migrate.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/model/migrate.rs b/src/model/migrate.rs
index 1f063265..25acb4b0 100644
--- a/src/model/migrate.rs
+++ b/src/model/migrate.rs
@@ -25,11 +25,15 @@ impl Migrate {
.open_tree("bucket:table")
.map_err(GarageError::from)?;
+ let mut old_buckets = vec![];
for res in tree.iter().map_err(GarageError::from)? {
let (_k, v) = res.map_err(GarageError::from)?;
let bucket = rmp_serde::decode::from_read_ref::<_, old_bucket::Bucket>(&v[..])
.map_err(GarageError::from)?;
+ old_buckets.push(bucket);
+ }
+ for bucket in old_buckets {
if let old_bucket::BucketState::Present(p) = bucket.state.get() {
self.migrate_buckets050_do_bucket(&bucket, p).await?;
}