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
1d7ad117
Unverified
Commit
1d7ad117
authored
6 years ago
by
Richard van der Hoff
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3430 from matrix-org/rav/configurable_push_action_rotation
Make push actions rotation configurable
parents
ce0d9111
75dc3dde
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/event_push_actions.py
+5
-3
5 additions, 3 deletions
synapse/storage/event_push_actions.py
with
5 additions
and
3 deletions
synapse/storage/event_push_actions.py
+
5
−
3
View file @
1d7ad117
...
@@ -83,6 +83,8 @@ class EventPushActionsWorkerStore(SQLBaseStore):
...
@@ -83,6 +83,8 @@ class EventPushActionsWorkerStore(SQLBaseStore):
self
.
find_stream_orderings_looping_call
=
self
.
_clock
.
looping_call
(
self
.
find_stream_orderings_looping_call
=
self
.
_clock
.
looping_call
(
self
.
_find_stream_orderings_for_times
,
10
*
60
*
1000
self
.
_find_stream_orderings_for_times
,
10
*
60
*
1000
)
)
self
.
_rotate_delay
=
3
self
.
_rotate_count
=
10000
@cachedInlineCallbacks
(
num_args
=
3
,
tree
=
True
,
max_entries
=
5000
)
@cachedInlineCallbacks
(
num_args
=
3
,
tree
=
True
,
max_entries
=
5000
)
def
get_unread_event_push_actions_by_room_for_user
(
def
get_unread_event_push_actions_by_room_for_user
(
...
@@ -799,7 +801,7 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
...
@@ -799,7 +801,7 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
)
)
if
caught_up
:
if
caught_up
:
break
break
yield
self
.
hs
.
get_clock
().
sleep
(
5
)
yield
self
.
hs
.
get_clock
().
sleep
(
self
.
_rotate_delay
)
finally
:
finally
:
self
.
_doing_notif_rotation
=
False
self
.
_doing_notif_rotation
=
False
...
@@ -820,8 +822,8 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
...
@@ -820,8 +822,8 @@ class EventPushActionsStore(EventPushActionsWorkerStore):
txn
.
execute
(
"""
txn
.
execute
(
"""
SELECT stream_ordering FROM event_push_actions
SELECT stream_ordering FROM event_push_actions
WHERE stream_ordering > ?
WHERE stream_ordering > ?
ORDER BY stream_ordering ASC LIMIT 1 OFFSET
50000
ORDER BY stream_ordering ASC LIMIT 1 OFFSET
?
"""
,
(
old_rotate_stream_ordering
,))
"""
,
(
old_rotate_stream_ordering
,
self
.
_rotate_count
))
stream_row
=
txn
.
fetchone
()
stream_row
=
txn
.
fetchone
()
if
stream_row
:
if
stream_row
:
offset_stream_ordering
,
=
stream_row
offset_stream_ordering
,
=
stream_row
...
...
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