diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-03-16 10:09:15 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-03-16 10:09:15 +0000 |
commit | f9232c7917322de392921336b4bab5d85c213c4e (patch) | |
tree | ab55547f1c895da508e6ac37c8056fef5b3b754e /synapse/push/__init__.py | |
parent | Fix remaining scheduler bugs. Add more informative logging. (diff) | |
parent | add ToC and fix typoe (diff) | |
download | synapse-f9232c7917322de392921336b4bab5d85c213c4e.tar.xz |
Merge branch 'develop' into application-services-txn-reliability
Conflicts: synapse/storage/appservice.py
Diffstat (limited to 'synapse/push/__init__.py')
-rw-r--r-- | synapse/push/__init__.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/synapse/push/__init__.py b/synapse/push/__init__.py index 3da0ce8703..0727f772a5 100644 --- a/synapse/push/__init__.py +++ b/synapse/push/__init__.py @@ -32,7 +32,7 @@ class Pusher(object): INITIAL_BACKOFF = 1000 MAX_BACKOFF = 60 * 60 * 1000 GIVE_UP_AFTER = 24 * 60 * 60 * 1000 - DEFAULT_ACTIONS = ['dont-notify'] + DEFAULT_ACTIONS = ['dont_notify'] INEQUALITY_EXPR = re.compile("^([=<>]*)([0-9]*)$") @@ -105,7 +105,11 @@ class Pusher(object): room_member_count += 1 for r in rules: - if r['rule_id'] in enabled_map and not enabled_map[r['rule_id']]: + if r['rule_id'] in enabled_map: + r['enabled'] = enabled_map[r['rule_id']] + elif 'enabled' not in r: + r['enabled'] = True + if not r['enabled']: continue matches = True @@ -124,13 +128,21 @@ class Pusher(object): # ignore rules with no actions (we have an explict 'dont_notify') if len(actions) == 0: logger.warn( - "Ignoring rule id %s with no actions for user %s" % - (r['rule_id'], r['user_name']) + "Ignoring rule id %s with no actions for user %s", + r['rule_id'], self.user_name ) continue if matches: + logger.info( + "%s matches for user %s, event %s", + r['rule_id'], self.user_name, ev['event_id'] + ) defer.returnValue(actions) + logger.info( + "No rules match for user %s, event %s", + self.user_name, ev['event_id'] + ) defer.returnValue(Pusher.DEFAULT_ACTIONS) @staticmethod |