Skip to content

Commit ae95f28

Browse files
committed
prepare BaoFileHandle to be the full state
1 parent 77fbb05 commit ae95f28

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/store/fs/bao_file.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use super::{
3131
use crate::{
3232
api::blobs::Bitfield,
3333
store::{
34-
fs::{meta::raw_outboard_size, HashContext},
34+
fs::{meta::raw_outboard_size, util::entity_manager, HashContext},
3535
util::{
3636
read_checksummed_and_truncate, write_checksummed, FixedSize, MemOrFile,
3737
PartialMemStorage, DD,
@@ -514,9 +514,15 @@ impl BaoFileStorage {
514514
}
515515

516516
/// A cheaply cloneable handle to a bao file, including the hash and the configuration.
517-
#[derive(Debug, Clone, derive_more::Deref)]
517+
#[derive(Debug, Clone, Default, derive_more::Deref)]
518518
pub(crate) struct BaoFileHandle(Arc<watch::Sender<BaoFileStorage>>);
519519

520+
impl entity_manager::Reset for BaoFileHandle {
521+
fn reset(&mut self) {
522+
self.send_replace(BaoFileStorage::Initial);
523+
}
524+
}
525+
520526
impl BaoFileHandle {
521527
pub(super) async fn load(&self, ctx: &HashContext) {
522528
enum Action {

0 commit comments

Comments
 (0)