Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
28781b65
Commit
28781b65
authored
6 years ago
by
Neil Johnson
Browse files
Options
Downloads
Patches
Plain Diff
fix #3854
parent
bf01efb8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/monthly_active_users.py
+4
-1
4 additions, 1 deletion
synapse/storage/monthly_active_users.py
with
4 additions
and
1 deletion
synapse/storage/monthly_active_users.py
+
4
−
1
View file @
28781b65
...
@@ -172,6 +172,10 @@ class MonthlyActiveUsersStore(SQLBaseStore):
...
@@ -172,6 +172,10 @@ class MonthlyActiveUsersStore(SQLBaseStore):
Deferred[bool]: True if a new entry was created, False if an
Deferred[bool]: True if a new entry was created, False if an
existing one was updated.
existing one was updated.
"""
"""
# Am consciously deciding to lock the table on the basis that is ought
# never be a big table and alternative approaches (batching multiple
# upserts into a single txn) introduced a lot of extra complexity.
# See https://github.com/matrix-org/synapse/issues/3854 for more
is_insert
=
yield
self
.
_simple_upsert
(
is_insert
=
yield
self
.
_simple_upsert
(
desc
=
"
upsert_monthly_active_user
"
,
desc
=
"
upsert_monthly_active_user
"
,
table
=
"
monthly_active_users
"
,
table
=
"
monthly_active_users
"
,
...
@@ -181,7 +185,6 @@ class MonthlyActiveUsersStore(SQLBaseStore):
...
@@ -181,7 +185,6 @@ class MonthlyActiveUsersStore(SQLBaseStore):
values
=
{
values
=
{
"
timestamp
"
:
int
(
self
.
_clock
.
time_msec
()),
"
timestamp
"
:
int
(
self
.
_clock
.
time_msec
()),
},
},
lock
=
False
,
)
)
if
is_insert
:
if
is_insert
:
self
.
user_last_seen_monthly_active
.
invalidate
((
user_id
,))
self
.
user_last_seen_monthly_active
.
invalidate
((
user_id
,))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment