summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-02-23 16:55:57 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-02-23 16:55:57 +0000
commita09e59a69830ba99d65f54b2385c3cab341accb0 (patch)
tree144add6ce2ce89b0a204e979a0b0a49fe0383183 /synapse/storage/_base.py
parentUse the @cached decorator to implement the destination_retry_timings cache (diff)
downloadsynapse-a09e59a69830ba99d65f54b2385c3cab341accb0.tar.xz
Pull the _get_event_cache.setdefault() call out of the try block, as it doesn't need to be there and is confusing
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 4b1ec687c9..84f222b3db 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -636,8 +636,9 @@ class SQLBaseStore(object):
         start_time = time.time() * 1000
         update_counter = self._get_event_counters.update
 
+        cache = self._get_event_cache.setdefault(event_id, {})
+
         try:
-            cache = self._get_event_cache.setdefault(event_id, {})
             # Separate cache entries for each way to invoke _get_event_txn
             return cache[(check_redacted, get_prev_content, allow_rejected)]
         except KeyError: