* [PATCH 2/3] searchidx: persist the PublicInbox::Git object
2016-08-09 0:22 3% [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 can cheaply keep the object around nowadays since it
spawns expensive processes only on an as-needed basis.
---
lib/PublicInbox/SearchIdx.pm | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 9a462c7..2c4e704 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -44,6 +44,7 @@ sub new {
my $umask = _umask_for($perm);
$self->{umask} = $umask;
$self->{lock_path} = "$git_dir/ssoma.lock";
+ $self->{git} = PublicInbox::Git->new($git_dir);
$self->{xdb} = $self->with_umask(sub {
if ($writable == 1) {
require File::Path;
@@ -349,7 +350,7 @@ sub rlog {
my $h40 = $hex .'{40}';
my $addmsg = qr!^:000000 100644 \S+ ($h40) A\t${hex}{2}/${hex}{38}$!;
my $delmsg = qr!^:100644 000000 ($h40) \S+ D\t${hex}{2}/${hex}{38}$!;
- my $git = PublicInbox::Git->new($self->{git_dir});
+ my $git = $self->{git};
my $log = $git->popen(qw/log --reverse --no-notes --no-color
--raw -r --no-abbrev/, $range);
my $latest;
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/3] searchidx: workaround lack of close-on-exec
@ 2016-08-09 0:22 3% Eric Wong
2016-08-09 0:22 7% ` [PATCH 2/3] searchidx: persist the PublicInbox::Git object 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 3%]
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 3% [PATCH 0/3] searchidx: workaround lack of close-on-exec Eric Wong
2016-08-09 0:22 7% ` [PATCH 2/3] searchidx: persist the PublicInbox::Git object 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).