Permalink
Browse files

Prevent more duplicate

  • Loading branch information...
1 parent d09f0cd commit f727dbdaf339aee4c50623124dea078f3c2d95b6 @AnthorNet AnthorNet committed on GitHub Jan 9, 2017
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/eddn/core/DuplicateMessages.py
@@ -41,11 +41,15 @@ def isDuplicated(self, message):
return False
if message['header']['gatewayTimestamp']:
- del message['header']['gatewayTimestamp'] # Prevent dupe with new timestamp ^^
+ del message['header']['gatewayTimestamp'] # Prevent dupe with new timestamp
if message['message']['timestamp']:
- del message['message']['timestamp'] # Prevent dupe with new timestamp ^^
+ del message['message']['timestamp'] # Prevent dupe with new timestamp
+ if message['header']['softwareName']:
+ del message['header']['softwareName'] # Prevent dupe with different software
+ if message['header']['softwareVersion']:
+ del message['header']['softwareVersion'] # Prevent dupe with different software version
- message = simplejson.dumps(message)
+ message = simplejson.dumps(message, sort_keys=True) # Ensure most duplicate messages will get the same key
key = hashlib.sha256(message).hexdigest()
if key not in self.caches:

0 comments on commit f727dbd

Please sign in to comment.