mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 09:05:33 +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 {
|
loop {
|
||||||
let time_queue = Local::now();
|
let time_queue = Local::now();
|
||||||
log::debug!("queue crawl begin at {time_queue}...");
|
log::debug!("queue crawl begin at {time_queue}...");
|
||||||
ban.retain(|i, &mut t| {
|
ban.retain(|i, &mut expires| {
|
||||||
let is_expired = t >= time_queue;
|
if time_queue > expires {
|
||||||
if is_expired {
|
|
||||||
log::debug!(
|
log::debug!(
|
||||||
"remove ban for `{}` by the timeout expiration ({t})",
|
"remove ban for `{}` by the timeout expiration ({expires})",
|
||||||
i.as_string()
|
i.as_string()
|
||||||
)
|
);
|
||||||
|
false
|
||||||
|
} else {
|
||||||
|
true
|
||||||
}
|
}
|
||||||
is_expired
|
|
||||||
});
|
});
|
||||||
for source in &config.infohash {
|
for source in &config.infohash {
|
||||||
log::debug!("index source `{source}`...");
|
log::debug!("index source `{source}`...");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue