2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 19:31:35 +00:00

Add blurhash cleanup for sled

This commit is contained in:
asonix 2024-03-03 11:11:43 -06:00
parent 719626de07
commit 4897c90ed7

View file

@ -1411,6 +1411,7 @@ impl HashRepo for SledRepo {
let hash_identifiers = self.hash_identifiers.clone(); let hash_identifiers = self.hash_identifiers.clone();
let hash_motion_identifiers = self.hash_motion_identifiers.clone(); let hash_motion_identifiers = self.hash_motion_identifiers.clone();
let hash_variant_identifiers = self.hash_variant_identifiers.clone(); let hash_variant_identifiers = self.hash_variant_identifiers.clone();
let hash_blurhashes = self.hash_blurhashes.clone();
let hash2 = hash.clone(); let hash2 = hash.clone();
let variant_keys = b!(self.hash_variant_identifiers, { let variant_keys = b!(self.hash_variant_identifiers, {
@ -1430,6 +1431,7 @@ impl HashRepo for SledRepo {
&hash_identifiers, &hash_identifiers,
&hash_motion_identifiers, &hash_motion_identifiers,
&hash_variant_identifiers, &hash_variant_identifiers,
&hash_blurhashes,
) )
.transaction( .transaction(
|( |(
@ -1438,6 +1440,7 @@ impl HashRepo for SledRepo {
hash_identifiers, hash_identifiers,
hash_motion_identifiers, hash_motion_identifiers,
hash_variant_identifiers, hash_variant_identifiers,
hash_blurhashes,
)| { )| {
if let Some(value) = hashes.remove(&hash)? { if let Some(value) = hashes.remove(&hash)? {
hashes_inverse.remove(value)?; hashes_inverse.remove(value)?;
@ -1450,6 +1453,8 @@ impl HashRepo for SledRepo {
hash_variant_identifiers.remove(key)?; hash_variant_identifiers.remove(key)?;
} }
hash_blurhashes.remove(&hash)?;
Ok(()) Ok(())
}, },
) )