mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-26 12:16:12 +00:00
Use cached get_user_by_access_token in slaves
This commit is contained in:
parent
dc3a00f24f
commit
a2427981b7
@ -51,6 +51,6 @@ class BaseSlavedStore(SQLBaseStore):
|
|||||||
try:
|
try:
|
||||||
getattr(self, cache_func).invalidate(tuple(keys))
|
getattr(self, cache_func).invalidate(tuple(keys))
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.warn("Got unexpected cache_func: %r", cache_func)
|
logger.info("Got unexpected cache_func: %r", cache_func)
|
||||||
self._cache_id_gen.advance(int(stream["position"]))
|
self._cache_id_gen.advance(int(stream["position"]))
|
||||||
return defer.succeed(None)
|
return defer.succeed(None)
|
||||||
|
@ -25,6 +25,6 @@ class SlavedRegistrationStore(BaseSlavedStore):
|
|||||||
# TODO: use the cached version and invalidate deleted tokens
|
# TODO: use the cached version and invalidate deleted tokens
|
||||||
get_user_by_access_token = RegistrationStore.__dict__[
|
get_user_by_access_token = RegistrationStore.__dict__[
|
||||||
"get_user_by_access_token"
|
"get_user_by_access_token"
|
||||||
].orig
|
]
|
||||||
|
|
||||||
_query_for_auth = DataStore._query_for_auth.__func__
|
_query_for_auth = DataStore._query_for_auth.__func__
|
||||||
|
@ -880,6 +880,7 @@ class SQLBaseStore(object):
|
|||||||
ctx = self._cache_id_gen.get_next()
|
ctx = self._cache_id_gen.get_next()
|
||||||
stream_id = ctx.__enter__()
|
stream_id = ctx.__enter__()
|
||||||
txn.call_after(ctx.__exit__, None, None, None)
|
txn.call_after(ctx.__exit__, None, None, None)
|
||||||
|
txn.call_after(self.hs.get_notifier().on_new_replication_data)
|
||||||
|
|
||||||
self._simple_insert_txn(
|
self._simple_insert_txn(
|
||||||
txn,
|
txn,
|
||||||
|
Loading…
Reference in New Issue
Block a user