diff options
author | Erik Johnston <erik@matrix.org> | 2019-09-05 17:27:46 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-09-05 17:27:46 +0100 |
commit | 591d82f06b81738efe67c13cdeee0901c3b28946 (patch) | |
tree | 018ec1d3caaa956d2173e9b11c74f78619aba0de /synapse/storage/registration.py | |
parent | Fix test (diff) | |
parent | Merge pull request #5984 from matrix-org/joriks/opentracing_link_send_to_edu_... (diff) | |
download | synapse-591d82f06b81738efe67c13cdeee0901c3b28946.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/censor_redactions
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r-- | synapse/storage/registration.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py index 3f50324253..2d3c7e2dc9 100644 --- a/synapse/storage/registration.py +++ b/synapse/storage/registration.py @@ -869,6 +869,17 @@ class RegistrationStore( (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,)) txn.call_after(self.is_guest.invalidate, (user_id,)) @@ -1140,6 +1151,7 @@ class RegistrationStore( deferred str|None: A str representing a link to redirect the user to if there is one. """ + # Insert everything into a transaction in order to run atomically def validate_threepid_session_txn(txn): row = self._simple_select_one_txn( |