sub _cleanup_later ($) {
my ($self) = @_;
+ return unless $PublicInbox::EvCleanup::ENABLED;
$cleanup_timer ||= PublicInbox::EvCleanup::later(*cleanup_task);
$CLEANUP->{"$self"} = $self;
}
_set_uint($opts, 'feedmax', 25);
$opts->{nntpserver} ||= $pi_config->{'publicinbox.nntpserver'};
my $dir = $opts->{mainrepo};
- if (defined $dir && -f "$dir/msgmap.sqlite3") { # XXX DIRTY
+ if (defined $dir && -f "$dir/inbox.lock") {
$opts->{version} = 2;
}
bless $opts, $class;
my ($self, $mid, $ref) = @_;
my $srch = search($self) or
return msg_by_path($self, mid2path($mid), $ref);
- my $smsg = $srch->lookup_skeleton($mid) or return;
- $smsg->load_expand;
- msg_by_smsg($self, $smsg, $ref);
+ my $smsg;
+ $srch->retry_reopen(sub {
+ $smsg = $srch->lookup_skeleton($mid) and $smsg->load_expand;
+ });
+ $smsg ? msg_by_smsg($self, $smsg, $ref) : undef;
}
1;