mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-20 10:55:09 +03:00
Handle user registration and ensure they start accruing statistics
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
This commit is contained in:
parent
1c9732d64b
commit
7f2ec2e954
1 changed files with 11 additions and 0 deletions
|
@ -824,6 +824,17 @@ class RegistrationStore(
|
||||||
(user_id_obj.localpart, create_profile_with_displayname),
|
(user_id_obj.localpart, create_profile_with_displayname),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if self.hs.config.stats_enabled:
|
||||||
|
# we create a new completed user statistics row
|
||||||
|
|
||||||
|
# we don't strictly need current_token since this user really can't
|
||||||
|
# have any state deltas before now (as it is a new user), but still,
|
||||||
|
# we include it for completeness.
|
||||||
|
current_token = self._get_max_stream_id_in_current_state_deltas_txn(txn)
|
||||||
|
self._update_stats_delta_txn(
|
||||||
|
txn, now, "user", user_id, {}, complete_with_stream_id=current_token
|
||||||
|
)
|
||||||
|
|
||||||
self._invalidate_cache_and_stream(txn, self.get_user_by_id, (user_id,))
|
self._invalidate_cache_and_stream(txn, self.get_user_by_id, (user_id,))
|
||||||
txn.call_after(self.is_guest.invalidate, (user_id,))
|
txn.call_after(self.is_guest.invalidate, (user_id,))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue