From 1b356e8d587a9c1bb92a11ffce255a3d3c25747c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 29 Jun 2020 10:34:17 +0000 Subject: watch: check for duplicates in ->over before spamcheck It's cheaper to check for duplicates than run `spamc' repeatedly when rechecking. We already do this for v1 with by using the "ls" command with fast-import, but v2 requires checking against over.sqlite3. --- lib/PublicInbox/V2Writable.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/V2Writable.pm') diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 8b31b69a..528f5e9a 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -171,7 +171,7 @@ sub _add { # spam check: if ($check_cb) { - $mime = $check_cb->($mime) or return; + $mime = $check_cb->($mime, $self->{-inbox}) or return; } # All pipes (> $^F) known to Perl 5.6+ have FD_CLOEXEC set, -- cgit v1.2.3-24-ge0c7