summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-10-25 14:58:59 +0100
committerNeil Johnson <neil@matrix.org>2018-10-25 14:58:59 +0100
commitf8fe98812be74e37432f11508c07488079bf949d (patch)
treedf4857947a23ae770a3e9e17e3801ae83bc0e25a /synapse
parentfix style inconsistencies (diff)
downloadsynapse-f8fe98812be74e37432f11508c07488079bf949d.tar.xz
improve comments
Diffstat (limited to '')
-rw-r--r--synapse/storage/monthly_active_users.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py
index 9a5c3b7eda..01963c879f 100644
--- a/synapse/storage/monthly_active_users.py
+++ b/synapse/storage/monthly_active_users.py
@@ -184,18 +184,18 @@ class MonthlyActiveUsersStore(SQLBaseStore):
             "upsert_monthly_active_user", self.upsert_monthly_active_user_txn,
             user_id
         )
-        # Considered pushing cache invalidation down into txn method, but
-        # did not because txn is not a LoggingTransaction. This means I could not
-        # call txn.call_after(). Therefore cache is altered in background thread
-        # and calls from elsewhere to user_last_seen_monthly_active and
-        # get_monthly_active_count fail with ValueError in
-        #  synapse/util/caches/descriptors.py#check_thread
+
         if is_insert:
             self.user_last_seen_monthly_active.invalidate((user_id,))
             self.get_monthly_active_count.invalidate(())
 
     def upsert_monthly_active_user_txn(self, txn, user_id):
         """Updates or inserts monthly active user member
+        Note that, after calling this method, it will generally be necessary
+        to invalidate the caches on user_last_seen_monthly_active and
+        get_monthly_active_count. We can't do that here, because we are running
+        in a database thread rather than the main thread, and we can't call
+        txn.call_after because txn may not be a LoggingTransaction.
 
         Args:
             txn (cursor):