Skip empty batch
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
kieran 2024-09-05 10:46:47 +01:00
parent 52ec0d7b5a
commit 458b5bb58a
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -55,6 +55,7 @@ impl FetchQueue {
while let Some(q) = q_lock.pop_front() { while let Some(q) = q_lock.pop_front() {
batch.push(q); batch.push(q);
} }
if batch.len() > 0 {
let filters: Vec<Filter> = let filters: Vec<Filter> =
batch.iter().map(move |x| Self::nip19_to_filter(&x.request).unwrap()).collect(); batch.iter().map(move |x| Self::nip19_to_filter(&x.request).unwrap()).collect();
@ -71,6 +72,7 @@ impl FetchQueue {
} }
} }
} }
}
fn nip19_to_filter(filter: &Nip19) -> Option<Filter> { fn nip19_to_filter(filter: &Nip19) -> Option<Filter> {
match filter { match filter {