my $term = 'Q' . $mid;
my $head = $db->postlist_begin($term);
my $tail = $db->postlist_end($term);
+ if ($head == $tail) {
+ $db->reopen;
+ $head = $db->postlist_begin($term);
+ $tail = $db->postlist_end($term);
+ }
return ($head, $tail, $db) if wantarray;
for (; $head->nequal($tail); $head->inc) {
my $doc_id = $head->get_docid;
$im->done;
my $cfgpfx = "publicinbox.v2test";
-my %cfg = (
+my $cfg = {
"$cfgpfx.address" => $ibx->{-primary_address},
"$cfgpfx.mainrepo" => $mainrepo,
-);
-
-my $config = PublicInbox::Config->new({ %cfg });
+};
+my $config = PublicInbox::Config->new($cfg);
my $www = PublicInbox::WWW->new($config);
my ($res, $raw, @from_);
test_psgi(sub { $www->call(@_) }, sub {
my $third = PublicInbox::MID::mid_clean($mids[0]);
$im->done;
-# need to reload...
-$config = PublicInbox::Config->new({ %cfg });
-$www = PublicInbox::WWW->new($config);
test_psgi(sub { $www->call(@_) }, sub {
my ($cb) = @_;
$res = $cb->(GET("/v2test/$third/raw"));