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
05b9f48e
Commit
05b9f48e
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix clearing out old device list outbound pokes
parent
1c13c9f6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/devices.py
+7
-2
7 additions, 2 deletions
synapse/storage/devices.py
with
7 additions
and
2 deletions
synapse/storage/devices.py
+
7
−
2
View file @
05b9f48e
...
...
@@ -545,7 +545,7 @@ class DeviceStore(SQLBaseStore):
(destination, user_id) tuple to ensure that the prev_ids remain correct
if the server does come back.
"""
now
=
self
.
_clock
.
time_msec
()
yesterday
=
self
.
_clock
.
time_msec
()
-
24
*
60
*
60
*
1000
def
_prune_txn
(
txn
):
select_sql
=
"""
...
...
@@ -557,6 +557,9 @@ class DeviceStore(SQLBaseStore):
txn
.
execute
(
select_sql
)
rows
=
txn
.
fetchall
()
if
not
rows
:
return
delete_sql
=
"""
DELETE FROM device_lists_outbound_pokes
WHERE ts < ? AND destination = ? AND user_id = ? AND stream_id < ?
...
...
@@ -565,11 +568,13 @@ class DeviceStore(SQLBaseStore):
txn
.
executemany
(
delete_sql
,
(
(
now
,
row
[
"
destination
"
],
row
[
"
user_id
"
],
row
[
"
stream_id
"
])
(
yesterday
,
row
[
0
],
row
[
1
],
row
[
2
])
for
row
in
rows
)
)
logger
.
info
(
"
Pruned %d device list outbound pokes
"
,
txn
.
rowcount
)
return
self
.
runInteraction
(
"
_prune_old_outbound_device_pokes
"
,
_prune_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