$self->{ibx}->with_umask(\&_add, $self, $eml, $check_cb);
}
+sub batch_bytes ($) {
+ my ($self) = @_;
+ ($self->{parallel} ? $self->{shards} : 1) *
+ $PublicInbox::SearchIdx::BATCH_BYTES;
+}
+
# indexes a message, returns true if checkpointing is needed
sub do_idx ($$$$) {
my ($self, $msgref, $mime, $smsg) = @_;
my $idx = idx_shard($self, $smsg->{num} % $self->{shards});
$idx->index_raw($msgref, $mime, $smsg);
my $n = $self->{transact_bytes} += $smsg->{raw_bytes};
- $n >= ($PublicInbox::SearchIdx::BATCH_BYTES * $self->{shards});
+ $n >= batch_bytes($self);
}
sub _add {
my $ibx = $self->{ibx};
my $all = $ibx->git;
my $over = $ibx->over;
- my $batch_bytes = $PublicInbox::SearchIdx::BATCH_BYTES;
+ my $batch_bytes = batch_bytes($self);
$step //= $self->{shards};
my $end = $sync->{art_end};
if (my $pr = $sync->{-opt}->{-progress}) {