mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
return ban time on item is banned
This commit is contained in:
parent
4f9714e5bb
commit
d1d628e878
2 changed files with 4 additions and 4 deletions
|
|
@ -20,8 +20,8 @@ impl Ban {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn has(&self, key: &Id20) -> bool {
|
||||
self.index.contains_key(key)
|
||||
pub fn get(&self, key: &Id20) -> Option<&DateTime<Local>> {
|
||||
self.index.get(key)
|
||||
}
|
||||
|
||||
pub fn total(&self) -> usize {
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ async fn main() -> Result<()> {
|
|||
log::debug!("torrent `{h}` exists, skip.");
|
||||
continue;
|
||||
}
|
||||
if ban.has(&i) {
|
||||
log::debug!("torrent `{h}` is temporary banned, skip for this queue.");
|
||||
if let Some(t) = ban.get(&i) {
|
||||
log::debug!("torrent `{h}` is banned until {t}, skip for this queue.");
|
||||
continue;
|
||||
}
|
||||
log::debug!("index `{h}`...");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue