]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: remove "resent" message for duplicate Message-IDs
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:14:59 +0000 (08:14 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:18:31 +0000 (08:18 +0000)
public-inbox-watch gets restarted on reboots and whatnot, so
it could get pointlessly noisy.  This message was only useful
during initial development and imports.

lib/PublicInbox/V2Writable.pm
t/v2writable.t

index 30ca9cec47ce8474250119b3d76dbd7dd1c99be1..dc96b87a7239f4da40078fd002f8e5787ec4d2ee 100644 (file)
@@ -119,10 +119,10 @@ sub num_for {
                foreach my $m (@$mids) {
                        # read-only lookup now safe to do after above barrier
                        my $existing = $self->lookup_content($mime, $m);
-                       if ($existing) {
-                               warn "<$m> resent\n";
-                               return; # easy, don't store duplicates
-                       }
+                       # easy, don't store duplicates
+                       # note: do not add more diagnostic info here since
+                       # it gets noisy on public-inbox-watch restarts
+                       return if $existing;
                }
 
                # very unlikely:
index 2088f3fe2f4de47c3560886d2e24477d9c628d1f..85b48d2affff215f01951b67ebdfc9ebb0b8fb15 100644 (file)
@@ -57,7 +57,7 @@ if ('ensure git configs are correct') {
        my @warn;
        local $SIG{__WARN__} = sub { push @warn, @_ };
        is($im->add($mime), undef, 'obvious duplicate rejected');
-       like(join(' ', @warn), qr/resent/, 'warned about resent message');
+       is(scalar(@warn), 0, 'no warning about resent message');
 
        @warn = ();
        $mime->header_set('Message-Id', '<a-mid@b>', '<c@d>');