summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-03-27 16:16:58 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-03-27 16:16:58 +0000
commit3e420aebd86dbd641ddc07039b220420a43fc39c (patch)
treed37370c412b5bc2d053944b992ce83b3ea5fb6b9 /synapse
parentAdd another @cached wrapper, this time on get_presence_state() (diff)
downloadsynapse-3e420aebd86dbd641ddc07039b220420a43fc39c.tar.xz
Revert "Add another @cached wrapper, this time on get_presence_state()"
This reverts commit ff1fa0fbf80cbb636e4cce59846bb5dcc91ccd03.
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/presence.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/synapse/storage/presence.py b/synapse/storage/presence.py
index e6fc19ccec..87fba55439 100644
--- a/synapse/storage/presence.py
+++ b/synapse/storage/presence.py
@@ -13,9 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from twisted.internet import defer
-
-from ._base import SQLBaseStore, cached
+from ._base import SQLBaseStore
 
 
 class PresenceStore(SQLBaseStore):
@@ -35,7 +33,6 @@ class PresenceStore(SQLBaseStore):
             desc="has_presence_state",
         )
 
-    @cached()
     def get_presence_state(self, user_localpart):
         return self._simple_select_one(
             table="presence",
@@ -44,9 +41,8 @@ class PresenceStore(SQLBaseStore):
             desc="get_presence_state",
         )
 
-    @defer.inlineCallbacks
     def set_presence_state(self, user_localpart, new_state):
-        ret = yield self._simple_update_one(
+        return self._simple_update_one(
             table="presence",
             keyvalues={"user_id": user_localpart},
             updatevalues={"state": new_state["state"],
@@ -54,8 +50,6 @@ class PresenceStore(SQLBaseStore):
                           "mtime": self._clock.time_msec()},
             desc="set_presence_state",
         )
-        self.get_presence_state.invalidate(user_localpart)
-        defer.returnValue(ret)
 
     def allow_presence_visible(self, observed_localpart, observer_userid):
         return self._simple_insert(