diff options
author | Eric Wong <e@yhbt.net> | 2020-07-24 05:56:00 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-07-25 20:48:18 +0000 |
commit | 5ce7e26b1d7efc2fb1bb5310a756e7c873145246 (patch) | |
tree | 91537b2a3319ac59c4a7bdb6b75db2d0a00c831f /lib/PublicInbox/SearchIdx.pm | |
parent | 9dd7f90d71ee6d4ba533aee341c9dc44b06fcc6e (diff) | |
download | public-inbox-5ce7e26b1d7efc2fb1bb5310a756e7c873145246.tar.gz |
searchidx: rename _xdb_{acquire,release} => idx_
The "xdb" prefix was inaccurate since it's used by indexlevel=basic, which is Xapian-free. The '_' (underscore) prefix was also wrong for a method which is called across package boundaries.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdx.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 2d53b2d0..89c71679 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -77,7 +77,7 @@ sub new { sub need_xapian ($) { $_[0]->{indexlevel} =~ $xapianlevels } -sub _xdb_release { +sub idx_release { my ($self, $wake) = @_; if (need_xapian($self)) { my $xdb = delete $self->{xdb} or croak 'not acquired'; @@ -101,7 +101,7 @@ sub load_xapian_writable () { 1; } -sub _xdb_acquire { +sub idx_acquire { my ($self) = @_; my $flag; my $dir = $self->xdir; @@ -735,7 +735,7 @@ sub _index_sync { $git->cleanup; delete $self->{txn}; $xdb->cancel_transaction if $xdb; - $xdb = _xdb_release($self); + $xdb = idx_release($self); # ensure we leak no FDs to "git log" with Xapian <= 1.2 my $range = $lx eq '' ? $tip : "$lx..$tip"; @@ -766,7 +766,7 @@ sub _index_sync { $self->{over}->rethread_done($opts) if $newest; # all done $self->commit_txn_lazy; $git->cleanup; - $xdb = _xdb_release($self, $nr); + $xdb = idx_release($self, $nr); # let another process do some work... $pr->("indexed $nr/$self->{ntodo}\n") if $pr && $nr; if (!$newest) { # more to come @@ -805,7 +805,7 @@ sub remote_close { $? == 0 or die ref($self)." pid:$pid exited with: $?"; } else { die "transaction in progress $self\n" if $self->{txn}; - $self->_xdb_release if $self->{xdb}; + idx_release($self) if $self->{xdb}; } } @@ -821,7 +821,7 @@ sub remote_remove { sub _begin_txn { my ($self) = @_; - my $xdb = $self->{xdb} || $self->_xdb_acquire; + my $xdb = $self->{xdb} || idx_acquire($self); $self->{over}->begin_lazy if $self->{over}; $xdb->begin_transaction if $xdb; $self->{txn} = 1; |