diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2020-06-03 17:15:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-03 17:15:57 +0100 |
commit | e91abfd2919bcd42322099ecca8387a2dae9b06e (patch) | |
tree | e59704342cac86d26adbc5c4a40fea6a57a7823f /synapse/app/homeserver.py | |
parent | Check the changelog number in check-newsfragment (#7623) (diff) | |
download | synapse-e91abfd2919bcd42322099ecca8387a2dae9b06e.tar.xz |
async/await get_user_id_by_threepid (#7620)
Based on #7619 async's `get_user_id_by_threepid` and its call stack.
Diffstat (limited to 'synapse/app/homeserver.py')
-rw-r--r-- | synapse/app/homeserver.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 93a5ba2100..730a2c015b 100644 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -617,18 +617,17 @@ def run(hs): clock.looping_call(reap_monthly_active_users, 1000 * 60 * 60) reap_monthly_active_users() - @defer.inlineCallbacks - def generate_monthly_active_users(): + async def generate_monthly_active_users(): current_mau_count = 0 current_mau_count_by_service = {} reserved_users = () store = hs.get_datastore() if hs.config.limit_usage_by_mau or hs.config.mau_stats_only: - current_mau_count = yield store.get_monthly_active_count() + current_mau_count = await store.get_monthly_active_count() current_mau_count_by_service = ( - yield store.get_monthly_active_count_by_service() + await store.get_monthly_active_count_by_service() ) - reserved_users = yield store.get_registered_reserved_users() + reserved_users = await store.get_registered_reserved_users() current_mau_gauge.set(float(current_mau_count)) for app_service, count in current_mau_count_by_service.items(): |