summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-09 07:37:51 -0400
committerGitHub <noreply@github.com>2020-10-09 07:37:51 -0400
commitfe0f4a3591302176c7eea48a54f6ed83d9eb4aa9 (patch)
tree831e5624bda8c4540ed5df42f1c78b0304d4d5f0 /synapse/app
parentRemove the deprecated Handlers object (#8494) (diff)
downloadsynapse-fe0f4a3591302176c7eea48a54f6ed83d9eb4aa9.tar.xz
Move additional tasks to the background worker, part 3 (#8489)
Diffstat (limited to 'synapse/app')
-rw-r--r--synapse/app/phone_stats_home.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/synapse/app/phone_stats_home.py b/synapse/app/phone_stats_home.py
index 8a69104a04..c38cf8231f 100644
--- a/synapse/app/phone_stats_home.py
+++ b/synapse/app/phone_stats_home.py
@@ -18,10 +18,7 @@ import sys
 
 from prometheus_client import Gauge
 
-from synapse.metrics.background_process_metrics import (
-    run_as_background_process,
-    wrap_as_background_process,
-)
+from synapse.metrics.background_process_metrics import wrap_as_background_process
 
 logger = logging.getLogger("synapse.app.homeserver")
 
@@ -152,13 +149,8 @@ def start_phone_stats_home(hs):
     clock.looping_call(hs.get_datastore().generate_user_daily_visits, 5 * 60 * 1000)
 
     # monthly active user limiting functionality
-    def reap_monthly_active_users():
-        return run_as_background_process(
-            "reap_monthly_active_users", hs.get_datastore().reap_monthly_active_users
-        )
-
-    clock.looping_call(reap_monthly_active_users, 1000 * 60 * 60)
-    reap_monthly_active_users()
+    clock.looping_call(hs.get_datastore().reap_monthly_active_users, 1000 * 60 * 60)
+    hs.get_datastore().reap_monthly_active_users()
 
     @wrap_as_background_process("generate_monthly_active_users")
     async def generate_monthly_active_users():