From d99020ac3612308d04e3760bd780417218748168 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 19 Aug 2021 01:36:38 +0000 Subject: lei q: make --save the default Since "lei up" is more often useful than not and incurs neglible overhead; enable --save by default and allow --no-save to work. This also fixes a long-standing when overwriting --output destinations with saved searches: dedupe data from previous searches are reset and no longer influences the new (changed) search, so results no longer go missing if two sequential invocations of "lei q --save" point to the same --output. --- lib/PublicInbox/LeiSavedSearch.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/PublicInbox/LeiSavedSearch.pm') diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm index 2a0e9321..fd51fe38 100644 --- a/lib/PublicInbox/LeiSavedSearch.pm +++ b/lib/PublicInbox/LeiSavedSearch.pm @@ -243,6 +243,16 @@ sub pause_dedupe { $oidx->commit_lazy; } +sub reset_dedupe { + my ($self) = @_; + prepare_dedupe($self); + my $lk = $self->lock_for_scope_fast; + for my $t (qw(xref3 over id2num)) { + $self->{oidx}->{dbh}->do("DELETE FROM $t"); + } + pause_dedupe($self); +} + sub mm { undef } sub altid_map { {} } -- cgit v1.2.3-24-ge0c7