Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
fd8e921b
Commit
fd8e921b
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge pull request #779 from matrix-org/erikj/receipts
Use tree cache for get_linearized_receipts_for_room
parents
024cda9a
6da7f39d
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/receipts.py
+3
-3
3 additions, 3 deletions
synapse/storage/receipts.py
with
3 additions
and
3 deletions
synapse/storage/receipts.py
+
3
−
3
View file @
fd8e921b
...
...
@@ -100,7 +100,7 @@ class ReceiptsStore(SQLBaseStore):
defer
.
returnValue
([
ev
for
res
in
results
.
values
()
for
ev
in
res
])
@cachedInlineCallbacks
(
num_args
=
3
,
max_entries
=
5000
)
@cachedInlineCallbacks
(
num_args
=
3
,
max_entries
=
5000
,
lru
=
True
,
tree
=
True
)
def
get_linearized_receipts_for_room
(
self
,
room_id
,
to_key
,
from_key
=
None
):
"""
Get receipts for a single room for sending to clients.
...
...
@@ -232,7 +232,7 @@ class ReceiptsStore(SQLBaseStore):
self
.
get_receipts_for_user
.
invalidate
,
(
user_id
,
receipt_type
)
)
# FIXME: This shouldn't invalidate the whole cache
txn
.
call_after
(
self
.
get_linearized_receipts_for_room
.
invalidate_
all
)
txn
.
call_after
(
self
.
get_linearized_receipts_for_room
.
invalidate_
many
,
(
room_id
,)
)
txn
.
call_after
(
self
.
_receipts_stream_cache
.
entity_has_changed
,
...
...
@@ -367,7 +367,7 @@ class ReceiptsStore(SQLBaseStore):
self
.
get_receipts_for_user
.
invalidate
,
(
user_id
,
receipt_type
)
)
# FIXME: This shouldn't invalidate the whole cache
txn
.
call_after
(
self
.
get_linearized_receipts_for_room
.
invalidate_
all
)
txn
.
call_after
(
self
.
get_linearized_receipts_for_room
.
invalidate_
many
,
(
room_id
,)
)
self
.
_simple_delete_txn
(
txn
,
...
...
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