mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-24 04:10:53 +03:00
DuplicateMessages: Refactor isDuplicated() name to snake_case
This commit is contained in:
parent
fb67f960be
commit
2d896ce37f
@ -229,7 +229,7 @@ class Monitor(Thread):
|
||||
|
||||
# Duplicates?
|
||||
if Settings.RELAY_DUPLICATE_MAX_MINUTES:
|
||||
if duplicate_messages.isDuplicated(json):
|
||||
if duplicate_messages.is_duplicated(json):
|
||||
schema_id = 'DUPLICATE MESSAGE'
|
||||
|
||||
c = db.cursor()
|
||||
|
@ -156,7 +156,7 @@ class Relay(Thread):
|
||||
|
||||
# Handle duplicate message
|
||||
if Settings.RELAY_DUPLICATE_MAX_MINUTES:
|
||||
if duplicate_messages.isDuplicated(json):
|
||||
if duplicate_messages.is_duplicated(json):
|
||||
# We've already seen this message recently. Discard it.
|
||||
stats_collector.tally("duplicate")
|
||||
return
|
||||
|
@ -36,7 +36,7 @@ class DuplicateMessages(Thread):
|
||||
if self.caches[key] + timedelta(minutes=self.max_minutes) < max_time:
|
||||
del self.caches[key]
|
||||
|
||||
def isDuplicated(self, json):
|
||||
def is_duplicated(self, json):
|
||||
with self.lock:
|
||||
# Test messages are never duplicate, would be a pain to wait for another test :D
|
||||
if re.search('test', json['$schemaRef'], re.I):
|
||||
|
Loading…
x
Reference in New Issue
Block a user