summary refs log tree commit diff
path: root/synapse/app/homeserver.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-07-31 16:36:24 +0100
committerNeil Johnson <neil@matrix.org>2018-07-31 16:36:24 +0100
commit6ef983ce5cc0a1cd7323ac82c8eed41d72ff3a99 (patch)
treead017979b62ecbed42837f4af79cbf18e92f4f5f /synapse/app/homeserver.py
parentMerge pull request #3629 from ptman/patch-1 (diff)
downloadsynapse-6ef983ce5cc0a1cd7323ac82c8eed41d72ff3a99.tar.xz
api into monthly_active_users table
Diffstat (limited to 'synapse/app/homeserver.py')
-rwxr-xr-xsynapse/app/homeserver.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 57b815d777..79772fa61a 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -62,6 +62,7 @@ from synapse.rest.media.v0.content_repository import ContentRepoResource
 from synapse.server import HomeServer
 from synapse.storage import are_all_users_on_domain
 from synapse.storage.engines import IncorrectDatabaseSetup, create_engine
+from synapse.storage.monthly_active_users import MonthlyActiveUsersStore
 from synapse.storage.prepare_database import UpgradeDatabaseException, prepare_database
 from synapse.util.caches import CACHE_SIZE_FACTOR
 from synapse.util.httpresourcetree import create_resource_tree
@@ -511,6 +512,9 @@ def run(hs):
     # If you increase the loop period, the accuracy of user_daily_visits
     # table will decrease
     clock.looping_call(generate_user_daily_visit_stats, 5 * 60 * 1000)
+    clock.looping_call(
+        MonthlyActiveUsersStore(hs).reap_monthly_active_users, 1000 * 60 * 60
+    )
 
     if hs.config.report_stats:
         logger.info("Scheduling stats reporting for 3 hour intervals")