use PublicInbox::InboxWritable;
use PublicInbox::ContentHash qw(content_hash);
use PublicInbox::Eml;
-use PublicInbox::DS qw(now);
+use PublicInbox::DS qw(now add_timer);
use DBI qw(:sql_types); # SQL_BLOB
sub new {
$self->with_umask(\&_idx_init, $self, $opt);
$self->{oidx}->begin_lazy;
$self->{oidx}->eidx_prep;
- $self->git->batch_prepare;
- $self->{midx}->begin_txn;
+ $self->{midx}->create_xdb if @new;
}
sub _watch_commit { # PublicInbox::DS::add_timer callback
delete $self->{-commit_timer};
eidxq_process($self, $self->{-watch_sync});
eidxq_release($self);
- delete local $self->{-watch_sync}->{-regen_fmt};
+ my $fmt = delete $self->{-watch_sync}->{-regen_fmt};
reindex_checkpoint($self, $self->{-watch_sync});
+ $self->{-watch_sync}->{-regen_fmt} = $fmt;
# call event_step => done unless commit_timer is armed
PublicInbox::DS::requeue($self);
$pr->("indexing $ekey\n") if $pr;
$self->idx_init($opt);
sync_inbox($self, $self->{-watch_sync}, $ibx);
- $self->{-commit_timer} //= PublicInbox::DS::add_timer(
- $opt->{'commit-interval'} // 10,
+ $self->{-commit_timer} //= add_timer($opt->{'commit-interval'} // 10,
\&_watch_commit, $self);
}
*atfork_child = \&PublicInbox::V2Writable::atfork_child;
*idx_shard = \&PublicInbox::V2Writable::idx_shard;
*reindex_checkpoint = \&PublicInbox::V2Writable::reindex_checkpoint;
+*checkpoint = \&PublicInbox::V2Writable::checkpoint;
1;