SQLite might index quickly, so we hold the lock used by Xapian
for the duration. This probably needs to be reworked entirely,
actually.
my $mm = _msgmap_init($self);
my $dbh = $mm->{dbh} if $mm;
my $mm = _msgmap_init($self);
my $dbh = $mm->{dbh} if $mm;
my $cb = sub {
my ($commit, $more) = @_;
if ($dbh) {
$mm->last_commit($commit) if $commit;
$dbh->commit;
}
my $cb = sub {
my ($commit, $more) = @_;
if ($dbh) {
$mm->last_commit($commit) if $commit;
$dbh->commit;
}
- $xdb->set_metadata($mkey, $commit) if $mkey && $commit;
- $xdb->commit_transaction;
- $xdb = _xdb_release($self);
+ if (!$mm_only) {
+ $xdb->set_metadata($mkey, $commit) if $mkey && $commit;
+ $xdb->commit_transaction;
+ $xdb = _xdb_release($self);
+ }
# let another process do some work... <
if ($more) {
# let another process do some work... <
if ($more) {
- $xdb = _xdb_acquire($self);
- $xdb->begin_transaction;
+ if (!$mm_only) {
+ $xdb = _xdb_acquire($self);
+ $xdb->begin_transaction;
+ }
$dbh->begin_work if $dbh;
}
};
$dbh->begin_work if $dbh;
}
};
my $mkey_prev = $mkey;
$mkey = undef; # ignore xapian, for now
my $mlog = _git_log($self, $r);
my $mkey_prev = $mkey;
$mkey = undef; # ignore xapian, for now
my $mlog = _git_log($self, $r);
rlog($self, $mlog, *index_mm, *unindex_mm, $cb);
rlog($self, $mlog, *index_mm, *unindex_mm, $cb);
+ $mm_only = $mlog = undef;
# now deal with Xapian
$mkey = $mkey_prev;
$dbh = undef;
# now deal with Xapian
$mkey = $mkey_prev;
$dbh = undef;
- $xdb = _xdb_acquire($self);
- $xdb->begin_transaction;
rlog($self, $xlog, *index_mm2, *unindex_mm2, $cb);
}
} else {
rlog($self, $xlog, *index_mm2, *unindex_mm2, $cb);
}
} else {