diff options
author | Krombel <krombel@krombel.de> | 2017-06-21 14:48:21 +0200 |
---|---|---|
committer | Krombel <krombel@krombel.de> | 2017-06-21 14:48:21 +0200 |
commit | 4202fba82a255eb52783a91d873b91aa8ef2191c (patch) | |
tree | 73975e960b5a80f7a466cbf62810639662093d4a /synapse/storage/registration.py | |
parent | replaced json.dumps with encode_canonical_json (diff) | |
parent | Merge pull request #2292 from matrix-org/erikj/quarantine_media (diff) | |
download | synapse-4202fba82a255eb52783a91d873b91aa8ef2191c.tar.xz |
Merge branch 'develop' into avoid_duplicate_filters
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r-- | synapse/storage/registration.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py index ec2c52ab93..20acd58fcf 100644 --- a/synapse/storage/registration.py +++ b/synapse/storage/registration.py @@ -438,6 +438,19 @@ class RegistrationStore(background_updates.BackgroundUpdateStore): defer.returnValue(ret) @defer.inlineCallbacks + def count_nonbridged_users(self): + def _count_users(txn): + txn.execute(""" + SELECT COALESCE(COUNT(*), 0) FROM users + WHERE appservice_id IS NULL + """) + count, = txn.fetchone() + return count + + ret = yield self.runInteraction("count_users", _count_users) + defer.returnValue(ret) + + @defer.inlineCallbacks def find_next_generated_user_id_localpart(self): """ Gets the localpart of the next generated user ID. |