mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 16:36:03 -04:00
Fix UPSERTs on SQLite 3.24+ (#4477)
This commit is contained in:
parent
88f4df85ca
commit
7072fe3084
8 changed files with 30 additions and 18 deletions
|
@ -197,15 +197,21 @@ class MonthlyActiveUsersStore(SQLBaseStore):
|
|||
if is_support:
|
||||
return
|
||||
|
||||
is_insert = yield self.runInteraction(
|
||||
yield self.runInteraction(
|
||||
"upsert_monthly_active_user", self.upsert_monthly_active_user_txn,
|
||||
user_id
|
||||
)
|
||||
|
||||
if is_insert:
|
||||
self.user_last_seen_monthly_active.invalidate((user_id,))
|
||||
user_in_mau = self.user_last_seen_monthly_active.cache.get(
|
||||
(user_id,),
|
||||
None,
|
||||
update_metrics=False
|
||||
)
|
||||
if user_in_mau is None:
|
||||
self.get_monthly_active_count.invalidate(())
|
||||
|
||||
self.user_last_seen_monthly_active.invalidate((user_id,))
|
||||
|
||||
def upsert_monthly_active_user_txn(self, txn, user_id):
|
||||
"""Updates or inserts monthly active user member
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue