$smsg->{blob} eq $oid or bail($self, "BUG: $smsg->{blob} != $oid");
eval { $self->async_eml(PublicInbox::Eml->new($bref)) };
bail($self, "E: async_eml: $@") if $@;
- $http->next_step($self->can('async_next'));
+ if ($self->{-low_prio}) {
+ push(@{$self->{www}->{-low_prio_q}}, $self) == 1 and
+ PublicInbox::DS::requeue($self->{www});
+ } else {
+ $http->next_step($self->can('async_next'));
+ }
}
sub smsg_blob {
[404, [qw(Content-Type text/plain)], ["No results found\n"]];
$ctx->{ids} = $ids;
$ctx->{prev} = $prev;
+ $ctx->{-low_prio} = 1;
require PublicInbox::MboxGz;
PublicInbox::MboxGz::mbox_gz($ctx, \&all_ids_cb, 'all');
}
my $smsg = $over->get_art($num) or next;
return $smsg;
}
- # refill result set
+ # refill result set, deprioritize since there's many results
my $srch = $ctx->{ibx}->isrch or return gone($ctx, 'search');
my $mset = $srch->mset($ctx->{query}, $ctx->{qopts});
my $size = $mset->size or return;
$ctx->{qopts}->{offset} += $size;
$ctx->{ids} = $srch->mset_to_artnums($mset, $ctx->{qopts});
+ $ctx->{-low_prio} = 1;
}
}
# refills ctx->{xids}
next if $over->expand_thread($ctx);
- # refill result set
+ # refill result set, deprioritize since there's many results
my $srch = $ctx->{ibx}->isrch or return gone($ctx, 'search');
my $mset = $srch->mset($ctx->{query}, $ctx->{qopts});
my $size = $mset->size or return;
$ctx->{qopts}->{offset} += $size;
$ctx->{ids} = $srch->mset_to_artnums($mset, $ctx->{qopts});
+ $ctx->{-low_prio} = 1;
}
}
};
}
+sub event_step { # called via requeue
+ my ($self) = @_;
+ # gzf = PublicInbox::GzipFilter == $ctx
+ my $gzf = shift(@{$self->{-low_prio_q}}) // return;
+ PublicInbox::DS::requeue($self) if scalar(@{$self->{-low_prio_q}});
+ my $http = $gzf->{env}->{'psgix.io'}; # PublicInbox::HTTP
+ $http->next_step($gzf->can('async_next'));
+}
+
1;