* [PATCH 1/3] searchidx: remove unused $git parameters
2016-08-09 0:22 6% [PATCH 0/3] searchidx: workaround lack of close-on-exec Eric Wong
@ 2016-08-09 0:22 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-08-09 0:22 UTC (permalink / raw)
To: meta
We do not need to pass the PublicInbox::Git object to
various callbacks.
---
lib/PublicInbox/SearchIdx.pm | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index a69428a..9a462c7 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -283,48 +283,48 @@ sub link_message {
}
sub index_blob {
- my ($self, $git, $mime, $bytes, $num, $blob) = @_;
+ my ($self, $mime, $bytes, $num, $blob) = @_;
$self->add_message($mime, $bytes, $num, $blob);
}
sub unindex_blob {
- my ($self, $git, $mime) = @_;
+ my ($self, $mime) = @_;
my $mid = eval { mid_clean(mid_mime($mime)) };
$self->remove_message($mid) if defined $mid;
}
sub index_mm {
- my ($self, $git, $mime) = @_;
+ my ($self, $mime) = @_;
$self->{mm}->mid_insert(mid_clean(mid_mime($mime)));
}
sub unindex_mm {
- my ($self, $git, $mime) = @_;
+ my ($self, $mime) = @_;
$self->{mm}->mid_delete(mid_clean(mid_mime($mime)));
}
sub index_mm2 {
- my ($self, $git, $mime, $bytes, $blob) = @_;
+ my ($self, $mime, $bytes, $blob) = @_;
my $num = $self->{mm}->num_for(mid_clean(mid_mime($mime)));
- index_blob($self, $git, $mime, $bytes, $num, $blob);
+ index_blob($self, $mime, $bytes, $num, $blob);
}
sub unindex_mm2 {
- my ($self, $git, $mime) = @_;
+ my ($self, $mime) = @_;
$self->{mm}->mid_delete(mid_clean(mid_mime($mime)));
- unindex_blob($self, $git, $mime);
+ unindex_blob($self, $mime);
}
sub index_both {
- my ($self, $git, $mime, $bytes, $blob) = @_;
- my $num = index_mm($self, $git, $mime);
- index_blob($self, $git, $mime, $bytes, $num, $blob);
+ my ($self, $mime, $bytes, $blob) = @_;
+ my $num = index_mm($self, $mime);
+ index_blob($self, $mime, $bytes, $num, $blob);
}
sub unindex_both {
- my ($self, $git, $mime) = @_;
- unindex_blob($self, $git, $mime);
- unindex_mm($self, $git, $mime);
+ my ($self, $mime) = @_;
+ unindex_blob($self, $mime);
+ unindex_mm($self, $mime);
}
sub do_cat_mail {
@@ -361,11 +361,11 @@ sub rlog {
if ($line =~ /$addmsg/o) {
my $blob = $1;
my $mime = do_cat_mail($git, $blob, \$bytes) or next;
- $add_cb->($self, $git, $mime, $bytes, $blob);
+ $add_cb->($self, $mime, $bytes, $blob);
} elsif ($line =~ /$delmsg/o) {
my $blob = $1;
my $mime = do_cat_mail($git, $blob) or next;
- $del_cb->($self, $git, $mime);
+ $del_cb->($self, $mime);
} elsif ($line =~ /^commit ($h40)/o) {
if (defined $max && --$max <= 0) {
$max = $self->{batch_size};
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/3] searchidx: workaround lack of close-on-exec
@ 2016-08-09 0:22 6% Eric Wong
2016-08-09 0:22 7% ` [PATCH 1/3] searchidx: remove unused $git parameters Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-08-09 0:22 UTC (permalink / raw)
To: meta
Some versions of Xapian fail to set the close-on-exec flag
on locks; and it appears we must workaround them, for the next
few years.
ref: nntp://news.gmane.org/20160807000109.GC19864@survex.com
Eric Wong (3):
searchidx: remove unused $git parameters
searchidx: persist the PublicInbox::Git object
searchidx: release Xapian FDs before spawning git log
lib/PublicInbox/Import.pm | 2 +-
lib/PublicInbox/SearchIdx.pm | 173 +++++++++++++++++++++++--------------------
t/search.t | 9 ++-
3 files changed, 100 insertions(+), 84 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-08-09 0:22 6% [PATCH 0/3] searchidx: workaround lack of close-on-exec Eric Wong
2016-08-09 0:22 7% ` [PATCH 1/3] searchidx: remove unused $git parameters Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).