@@ -82,7 +82,7 @@ async def phone_stats_home(
8282 # General statistics
8383 #
8484
85- store = hs .get_datastore ()
85+ store = hs .get_datastores (). main
8686
8787 stats ["homeserver" ] = hs .config .server .server_name
8888 stats ["server_context" ] = hs .config .server .server_context
@@ -170,18 +170,22 @@ def performance_stats_init() -> None:
170170 # Rather than update on per session basis, batch up the requests.
171171 # If you increase the loop period, the accuracy of user_daily_visits
172172 # table will decrease
173- clock .looping_call (hs .get_datastore ().generate_user_daily_visits , 5 * 60 * 1000 )
173+ clock .looping_call (
174+ hs .get_datastores ().main .generate_user_daily_visits , 5 * 60 * 1000
175+ )
174176
175177 # monthly active user limiting functionality
176- clock .looping_call (hs .get_datastore ().reap_monthly_active_users , 1000 * 60 * 60 )
177- hs .get_datastore ().reap_monthly_active_users ()
178+ clock .looping_call (
179+ hs .get_datastores ().main .reap_monthly_active_users , 1000 * 60 * 60
180+ )
181+ hs .get_datastores ().main .reap_monthly_active_users ()
178182
179183 @wrap_as_background_process ("generate_monthly_active_users" )
180184 async def generate_monthly_active_users () -> None :
181185 current_mau_count = 0
182186 current_mau_count_by_service = {}
183187 reserved_users : Sized = ()
184- store = hs .get_datastore ()
188+ store = hs .get_datastores (). main
185189 if hs .config .server .limit_usage_by_mau or hs .config .server .mau_stats_only :
186190 current_mau_count = await store .get_monthly_active_count ()
187191 current_mau_count_by_service = (
0 commit comments