summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-06-03 17:15:57 +0100
committerGitHub <noreply@github.com>2020-06-03 17:15:57 +0100
commite91abfd2919bcd42322099ecca8387a2dae9b06e (patch)
treee59704342cac86d26adbc5c4a40fea6a57a7823f /synapse/app
parentCheck the changelog number in check-newsfragment (#7623) (diff)
downloadsynapse-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')
-rw-r--r--synapse/app/homeserver.py9
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():