diff options
author | Eric Wong <e@yhbt.net> | 2020-08-07 10:52:17 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-08-07 23:46:14 +0000 |
commit | 6fcad67f0dbaf33b354f07aa7f3c8fcfc8685bd7 (patch) | |
tree | 93aee2c786eec1540bf56587a2f2ff168c987928 /lib/PublicInbox/SearchIdx.pm | |
parent | 9030233f83bc2e30f9529ea484da123ea9d98119 (diff) | |
download | public-inbox-6fcad67f0dbaf33b354f07aa7f3c8fcfc8685bd7.tar.gz |
XAPIAN_FLUSH_THRESHOLD is a C string in the environment, so users may be tempted to assign an empty string in in their shell, e.g. `XAPIAN_FLUSH_THRESHOLD= <command>' instead of using `unset' POSIX shell built-in. With either a value of "0" or "" (empty string), Xapian will fall back to its default (10000 documents), which causes grief for memory-starved users.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdx.pm | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 22489731..01b9f52d 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -25,8 +25,7 @@ our @EXPORT_OK = qw(crlf_adjust log2stack is_ancestor check_size nodatacow_dir); my $X = \%PublicInbox::Search::X; my ($DB_CREATE_OR_OPEN, $DB_OPEN); our $DB_NO_SYNC = 0; -our $BATCH_BYTES = defined($ENV{XAPIAN_FLUSH_THRESHOLD}) ? - 0x7fffffff : 1_000_000; +our $BATCH_BYTES = $ENV{XAPIAN_FLUSH_THRESHOLD} ? 0x7fffffff : 1_000_000; use constant DEBUG => !!$ENV{DEBUG}; my $xapianlevels = qr/\A(?:full|medium)\z/; |