summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-02 11:04:18 +0100
committerNeil Johnson <neil@matrix.org>2018-08-02 11:04:18 +0100
commit4a6725d9d16659fe8553633e6e7d327af56c5542 (patch)
treebbd309f6f10e1311766af0a617ed32e88835bef0 /synapse/storage
parentRevert "change monthly_active_users table to be a single column" (diff)
parentself.db_conn unused (diff)
downloadsynapse-4a6725d9d16659fe8553633e6e7d327af56c5542.tar.xz
Merge branch 'neilj/mau_tracker' of github.com:matrix-org/synapse into neilj/mau_tracker
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/__init__.py1
-rw-r--r--synapse/storage/monthly_active_users.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py

index 134e4a80f1..04ff1f8006 100644 --- a/synapse/storage/__init__.py +++ b/synapse/storage/__init__.py
@@ -94,7 +94,6 @@ class DataStore(RoomMemberStore, RoomStore, self._clock = hs.get_clock() self.database_engine = hs.database_engine - self.db_conn = db_conn self._stream_id_gen = StreamIdGenerator( db_conn, "events", "stream_ordering", extra_tables=[("local_invites", "stream_id")] diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py
index 03eeea792e..2337438c58 100644 --- a/synapse/storage/monthly_active_users.py +++ b/synapse/storage/monthly_active_users.py
@@ -7,6 +7,7 @@ class MonthlyActiveUsersStore(SQLBaseStore): def __init__(self, hs): super(MonthlyActiveUsersStore, self).__init__(None, hs) self._clock = hs.get_clock() + self.max_mau_value = hs.config.max_mau_value def reap_monthly_active_users(self): """ @@ -19,7 +20,9 @@ class MonthlyActiveUsersStore(SQLBaseStore): thirty_days_ago = ( int(self._clock.time_msec()) - (1000 * 60 * 60 * 24 * 30) ) + sql = "DELETE FROM monthly_active_users WHERE timestamp < ?" + txn.execute(sql, (thirty_days_ago,)) return self.runInteraction("reap_monthly_active_users", _reap_users)