mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 17:56:19 +03:00
Update state_events and current_state_events upon receipt of a state
event #5690. Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
This commit is contained in:
parent
181c1a6072
commit
dc68c2a101
1 changed files with 11 additions and 0 deletions
|
@ -148,6 +148,17 @@ class StatsHandler(StateDeltasHandler):
|
|||
# quantise time to the nearest bucket
|
||||
now = (now // 1000 // self.stats_bucket_size) * self.stats_bucket_size
|
||||
|
||||
yield self.store.update_stats_delta(
|
||||
now, "room", room_id, "state_events", +1
|
||||
)
|
||||
|
||||
if prev_event_id is None:
|
||||
# this state event doesn't overwrite another,
|
||||
# so it is a new effective/current state event
|
||||
yield self.store.update_stats_delta(
|
||||
now, "room", room_id, "current_state_events", +1
|
||||
)
|
||||
|
||||
if typ == EventTypes.Member:
|
||||
# we could use _get_key_change here but it's a bit inefficient
|
||||
# given we're not testing for a specific result; might as well
|
||||
|
|
Loading…
Reference in a new issue