Merge pull request #2062 from matrix-org/erikj/presence_replication
Use presence replication stream to invalidate cache
This commit is contained in:
commit
281553afe6
|
@ -57,5 +57,6 @@ class SlavedPresenceStore(BaseSlavedStore):
|
||||||
self.presence_stream_cache.entity_has_changed(
|
self.presence_stream_cache.entity_has_changed(
|
||||||
user_id, position
|
user_id, position
|
||||||
)
|
)
|
||||||
|
self._get_presence_for_user.invalidate((user_id,))
|
||||||
|
|
||||||
return super(SlavedPresenceStore, self).process_replication(result)
|
return super(SlavedPresenceStore, self).process_replication(result)
|
||||||
|
|
|
@ -85,8 +85,8 @@ class PresenceStore(SQLBaseStore):
|
||||||
self.presence_stream_cache.entity_has_changed,
|
self.presence_stream_cache.entity_has_changed,
|
||||||
state.user_id, stream_id,
|
state.user_id, stream_id,
|
||||||
)
|
)
|
||||||
self._invalidate_cache_and_stream(
|
txn.call_after(
|
||||||
txn, self._get_presence_for_user, (state.user_id,)
|
self._get_presence_for_user.invalidate, (state.user_id,)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Actually insert new rows
|
# Actually insert new rows
|
||||||
|
|
Loading…
Reference in New Issue