mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
update ban retain condition
This commit is contained in:
parent
3e68048856
commit
7eabd23a03
1 changed files with 7 additions and 6 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -70,15 +70,16 @@ async fn main() -> Result<()> {
|
|||
loop {
|
||||
let time_queue = Local::now();
|
||||
log::debug!("queue crawl begin at {time_queue}...");
|
||||
ban.retain(|i, &mut t| {
|
||||
let is_expired = t >= time_queue;
|
||||
if is_expired {
|
||||
ban.retain(|i, &mut expires| {
|
||||
if time_queue > expires {
|
||||
log::debug!(
|
||||
"remove ban for `{}` by the timeout expiration ({t})",
|
||||
"remove ban for `{}` by the timeout expiration ({expires})",
|
||||
i.as_string()
|
||||
)
|
||||
);
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
is_expired
|
||||
});
|
||||
for source in &config.infohash {
|
||||
log::debug!("index source `{source}`...");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue