mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-15 23:02:05 +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?
|
# Duplicates?
|
||||||
if Settings.RELAY_DUPLICATE_MAX_MINUTES:
|
if Settings.RELAY_DUPLICATE_MAX_MINUTES:
|
||||||
if duplicate_messages.isDuplicated(json):
|
if duplicate_messages.is_duplicated(json):
|
||||||
schema_id = 'DUPLICATE MESSAGE'
|
schema_id = 'DUPLICATE MESSAGE'
|
||||||
|
|
||||||
c = db.cursor()
|
c = db.cursor()
|
||||||
|
@ -156,7 +156,7 @@ class Relay(Thread):
|
|||||||
|
|
||||||
# Handle duplicate message
|
# Handle duplicate message
|
||||||
if Settings.RELAY_DUPLICATE_MAX_MINUTES:
|
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.
|
# We've already seen this message recently. Discard it.
|
||||||
stats_collector.tally("duplicate")
|
stats_collector.tally("duplicate")
|
||||||
return
|
return
|
||||||
|
@ -36,7 +36,7 @@ class DuplicateMessages(Thread):
|
|||||||
if self.caches[key] + timedelta(minutes=self.max_minutes) < max_time:
|
if self.caches[key] + timedelta(minutes=self.max_minutes) < max_time:
|
||||||
del self.caches[key]
|
del self.caches[key]
|
||||||
|
|
||||||
def isDuplicated(self, json):
|
def is_duplicated(self, json):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
# Test messages are never duplicate, would be a pain to wait for another test :D
|
# Test messages are never duplicate, would be a pain to wait for another test :D
|
||||||
if re.search('test', json['$schemaRef'], re.I):
|
if re.search('test', json['$schemaRef'], re.I):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user