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
f8fe9881
Commit
f8fe9881
authored
6 years ago
by
Neil Johnson
Browse files
Options
Downloads
Patches
Plain Diff
improve comments
parent
ea69a84b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/monthly_active_users.py
+6
-6
6 additions, 6 deletions
synapse/storage/monthly_active_users.py
with
6 additions
and
6 deletions
synapse/storage/monthly_active_users.py
+
6
−
6
View file @
f8fe9881
...
...
@@ -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):
...
...
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