summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-08-23 10:55:14 +0100
committerGitHub <noreply@github.com>2018-08-23 10:55:14 +0100
commitdddb5aa7bb30767023030dc33912b2816fb07c7d (patch)
treec6c6649a70a340be2295faf929ec7cc561a6d5fe
parentMerge pull request #3680 from matrix-org/neilj/server_notices_on_blocking (diff)
parentNewsfile (diff)
downloadsynapse-dddb5aa7bb30767023030dc33912b2816fb07c7d.tar.xz
Merge pull request #3746 from matrix-org/erikj/mau_fixups
Fix MAU invalidation due to missing yield
-rw-r--r--changelog.d/3746.misc1
-rw-r--r--synapse/storage/monthly_active_users.py3
-rw-r--r--tests/server_notices/__init__.py0
3 files changed, 3 insertions, 1 deletions
diff --git a/changelog.d/3746.misc b/changelog.d/3746.misc
new file mode 100644
index 0000000000..fc00ee773a
--- /dev/null
+++ b/changelog.d/3746.misc
@@ -0,0 +1 @@
+Fix MAU cache invalidation due to missing yield
diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py
index 06f9a75a97..fd3b630bd2 100644
--- a/synapse/storage/monthly_active_users.py
+++ b/synapse/storage/monthly_active_users.py
@@ -147,6 +147,7 @@ class MonthlyActiveUsersStore(SQLBaseStore):
             return count
         return self.runInteraction("count_users", _count_users)
 
+    @defer.inlineCallbacks
     def upsert_monthly_active_user(self, user_id):
         """
             Updates or inserts monthly active user member
@@ -155,7 +156,7 @@ class MonthlyActiveUsersStore(SQLBaseStore):
             Deferred[bool]: True if a new entry was created, False if an
                 existing one was updated.
         """
-        is_insert = self._simple_upsert(
+        is_insert = yield self._simple_upsert(
             desc="upsert_monthly_active_user",
             table="monthly_active_users",
             keyvalues={
diff --git a/tests/server_notices/__init__.py b/tests/server_notices/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/server_notices/__init__.py