diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-17 10:40:23 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-17 10:40:23 +0100 |
commit | 1a9510bb84d79f6ff78d32390195bc97ed9a439e (patch) | |
tree | b9ac0d1785e86d885e054070213c51428e9102f6 /synapse/storage | |
parent | Add batched version of store.get_presence_state (diff) | |
download | synapse-1a9510bb84d79f6ff78d32390195bc97ed9a439e.tar.xz |
Implement a batched presence_handler.get_state and use it
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/presence.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/presence.py b/synapse/storage/presence.py index f351b76a70..15d98198e2 100644 --- a/synapse/storage/presence.py +++ b/synapse/storage/presence.py @@ -50,13 +50,15 @@ class PresenceStore(SQLBaseStore): def f(txn): results = {} for user_localpart in user_localparts: - results[user_localpart] = self._simple_select_one_txn( + res = self._simple_select_one_txn( txn, table="presence", keyvalues={"user_id": user_localpart}, retcols=["state", "status_msg", "mtime"], - desc="get_presence_state", + allow_none=True, ) + if res: + results[user_localpart] = res return results |