Skip to content
Snippets Groups Projects
Commit 11293b35 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

Task #8887: do not send change notifications if new and old are equal

parent 60f082f3
No related branches found
No related tags found
No related merge requests found
...@@ -123,6 +123,12 @@ class RADBPGListener(PostgresListener): ...@@ -123,6 +123,12 @@ class RADBPGListener(PostgresListener):
def _sendNotification(self, subject, payload, timestampFields = None): def _sendNotification(self, subject, payload, timestampFields = None):
try: try:
content = json.loads(payload) content = json.loads(payload)
if 'new' in content and 'old' in content:
if content['new'] == content['old']:
logger.info('new and old values are equal, not sending notification. %s' % (content['new']))
return
if timestampFields: if timestampFields:
content = self._formatTimestampsAsIso(timestampFields, content) content = self._formatTimestampsAsIso(timestampFields, content)
except Exception as e: except Exception as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment