From: Michael Tremer Date: Tue, 16 Jun 2026 12:53:52 +0000 (+0000) Subject: importer: Ignore any duplicates in Spamhaus' feeds X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=HEAD;p=location%2Flibloc.git importer: Ignore any duplicates in Spamhaus' feeds Signed-off-by: Michael Tremer --- diff --git a/src/scripts/location-importer.in b/src/scripts/location-importer.in index fb4dead..aad6889 100644 --- a/src/scripts/location-importer.in +++ b/src/scripts/location-importer.in @@ -2407,7 +2407,14 @@ class CLI(object): VALUES ( %s, %s, %s - )""", "%s" % network, name, True, + ) + ON CONFLICT + ( + network, source + ) + DO + NOTHING + """, "%s" % network, name, True, ) # Raise an exception if we could not import anything @@ -2460,7 +2467,14 @@ class CLI(object): VALUES ( %s, %s, %s - )""", "%s" % asn, name, True, + ) + ON CONFLICT + ( + number, source + ) + DO + NOTHING + """, "%s" % asn, name, True, ) @staticmethod