]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiDedupe.pm
lei add-external: completion for existing URL basenames
[public-inbox.git] / lib / PublicInbox / LeiDedupe.pm
index 3f478aa4a786ba3280344ec2c10de9f2beb015f7..5c83fd8007ce55438f989ebd3a2bc835d05b7373 100644 (file)
@@ -5,6 +5,7 @@ use strict;
 use v5.10.1;
 use PublicInbox::SharedKV;
 use PublicInbox::ContentHash qw(content_hash);
+use Digest::SHA ();
 
 # n.b. mutt sets most of these headers not sure about Bytes
 our @OID_IGNORE = qw(Status X-Status Content-Length Lines Bytes);
@@ -103,8 +104,8 @@ sub new {
        bless [ $skv, undef, undef, $m ], $cls;
 }
 
-# returns true on unseen messages according to the deduplication strategy,
-# returns false if seen
+# returns true on seen messages according to the deduplication strategy,
+# returns false if unseen
 sub is_dup {
        my ($self, $eml, $oid) = @_;
        !$self->[1]->($eml, $oid);
@@ -125,6 +126,7 @@ sub prepare_dedupe {
 sub pause_dedupe {
        my ($self) = @_;
        my $skv = $self->[0];
+       $skv->dbh_release;
        delete($skv->{dbh}) if $skv;
 }