Clear have_bitfield on error
This commit is contained in:
parent
b7ed850918
commit
c697809e50
8 changed files with 88 additions and 32 deletions
|
|
@ -3,6 +3,7 @@ use crate::{api::TorrentIdOrHash, bitv::BitV, type_aliases::BF};
|
|||
#[async_trait::async_trait]
|
||||
pub trait BitVFactory: Send + Sync {
|
||||
async fn load(&self, id: TorrentIdOrHash) -> anyhow::Result<Option<Box<dyn BitV>>>;
|
||||
async fn clear(&self, id: TorrentIdOrHash) -> anyhow::Result<()>;
|
||||
async fn store_initial_check(
|
||||
&self,
|
||||
id: TorrentIdOrHash,
|
||||
|
|
@ -18,6 +19,10 @@ impl BitVFactory for NonPersistentBitVFactory {
|
|||
Ok(None)
|
||||
}
|
||||
|
||||
async fn clear(&self, _id: TorrentIdOrHash) -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn store_initial_check(
|
||||
&self,
|
||||
_id: TorrentIdOrHash,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue