Remove dead code

pull/502/head
Erik Johnston 2016-01-18 16:48:37 +00:00
parent 29c353c553
commit 5cd2126a6a
1 changed files with 1 additions and 22 deletions

View File

@ -14,7 +14,7 @@
# limitations under the License.
from ._base import SQLBaseStore
from synapse.util.caches.descriptors import cached, cachedInlineCallbacks
from synapse.util.caches.descriptors import cachedInlineCallbacks
from twisted.internet import defer
import logging
@ -60,27 +60,6 @@ class PushRuleStore(SQLBaseStore):
r['rule_id']: False if r['enabled'] == 0 else True for r in results
})
@cached()
def _get_push_rules_enabled_for_user(self, user_id):
def f(txn):
sql = (
"SELECT pr.*"
" FROM push_rules AS pr"
" LEFT JOIN push_rules_enable AS pre"
" ON pr.user_name = pre.user_name AND pr.rule_id = pre.rule_id"
" WHERE pr.user_name = ?"
" AND (pre.enabled IS NULL OR pre.enabled = 1)"
" ORDER BY pr.priority_class DESC, pr.priority DESC"
)
txn.execute(sql, (user_id,))
return self.cursor_to_dict(txn)
return self.runInteraction(
"_get_push_rules_enabled_for_user", f
)
# @cachedList(cache=_get_push_rules_enabled_for_user.cache, list_name="user_ids",
# num_args=1, inlineCallbacks=True)
@defer.inlineCallbacks
def bulk_get_push_rules(self, user_ids):
if not user_ids: