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
55460928
Commit
55460928
authored
5 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Run as background process and fix comments
parent
fc51e213
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
synapse/events/__init__.py
+1
-1
1 addition, 1 deletion
synapse/events/__init__.py
synapse/handlers/message.py
+5
-2
5 additions, 2 deletions
synapse/handlers/message.py
tests/storage/test_cleanup_extrems.py
+1
-1
1 addition, 1 deletion
tests/storage/test_cleanup_extrems.py
with
7 additions
and
4 deletions
synapse/events/__init__.py
+
1
−
1
View file @
55460928
...
@@ -93,7 +93,7 @@ class _EventInternalMetadata(object):
...
@@ -93,7 +93,7 @@ class _EventInternalMetadata(object):
return
getattr
(
self
,
"
soft_failed
"
,
False
)
return
getattr
(
self
,
"
soft_failed
"
,
False
)
def
should_proactively_send
(
self
):
def
should_proactively_send
(
self
):
"""
Whether the event
m
, if ours, should be sent to other clients and
"""
Whether the event, if ours, should be sent to other clients and
servers.
servers.
This is used for sending dummy events internally. Servers and clients
This is used for sending dummy events internally. Servers and clients
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/message.py
+
5
−
2
View file @
55460928
...
@@ -34,6 +34,7 @@ from synapse.api.errors import (
...
@@ -34,6 +34,7 @@ from synapse.api.errors import (
from
synapse.api.room_versions
import
RoomVersions
from
synapse.api.room_versions
import
RoomVersions
from
synapse.api.urls
import
ConsentURIBuilder
from
synapse.api.urls
import
ConsentURIBuilder
from
synapse.events.validator
import
EventValidator
from
synapse.events.validator
import
EventValidator
from
synapse.metrics.background_process_metrics
import
run_as_background_process
from
synapse.replication.http.send_event
import
ReplicationSendEventRestServlet
from
synapse.replication.http.send_event
import
ReplicationSendEventRestServlet
from
synapse.storage.state
import
StateFilter
from
synapse.storage.state
import
StateFilter
from
synapse.types
import
RoomAlias
,
UserID
,
create_requester
from
synapse.types
import
RoomAlias
,
UserID
,
create_requester
...
@@ -265,9 +266,11 @@ class EventCreationHandler(object):
...
@@ -265,9 +266,11 @@ class EventCreationHandler(object):
not
self
.
config
.
worker_app
not
self
.
config
.
worker_app
and
self
.
config
.
cleanup_extremities_with_dummy_events
and
self
.
config
.
cleanup_extremities_with_dummy_events
):
):
# XXX: Send dummy events.
self
.
clock
.
looping_call
(
self
.
clock
.
looping_call
(
self
.
_send_dummy_events_to_fill_extremities
,
lambda
:
run_as_background_process
(
"
send_dummy_events_to_fill_extremities
"
,
self
.
_send_dummy_events_to_fill_extremities
),
5
*
60
*
1000
,
5
*
60
*
1000
,
)
)
...
...
This diff is collapsed.
Click to expand it.
tests/storage/test_cleanup_extrems.py
+
1
−
1
View file @
55460928
...
@@ -255,7 +255,7 @@ class CleanupExtremDummyEventsTestCase(HomeserverTestCase):
...
@@ -255,7 +255,7 @@ class CleanupExtremDummyEventsTestCase(HomeserverTestCase):
)
)
self
.
assertEqual
(
len
(
latest_event_ids
),
50
)
self
.
assertEqual
(
len
(
latest_event_ids
),
50
)
#
B
ump the reacto repeatedly so that the background updates have a
#
P
ump the reacto
r
repeatedly so that the background updates have a
# chance to run.
# chance to run.
self
.
pump
(
10
*
60
)
self
.
pump
(
10
*
60
)
...
...
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