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
50114176
Commit
50114176
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fixup logging and docstrings
parent
051a99c4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/replication/http/_base.py
+4
-2
4 additions, 2 deletions
synapse/replication/http/_base.py
synapse/replication/http/membership.py
+36
-0
36 additions, 0 deletions
synapse/replication/http/membership.py
with
40 additions
and
2 deletions
synapse/replication/http/_base.py
+
4
−
2
View file @
50114176
...
@@ -151,7 +151,7 @@ class ReplicationEndpoint(object):
...
@@ -151,7 +151,7 @@ class ReplicationEndpoint(object):
if
e
.
code
!=
504
or
not
cls
.
RETRY_ON_TIMEOUT
:
if
e
.
code
!=
504
or
not
cls
.
RETRY_ON_TIMEOUT
:
raise
raise
logger
.
warn
(
"
s
end_federation_events_to_master
request timed out
"
)
logger
.
warn
(
"
%
s request timed out
"
,
cls
.
NAME
)
# If we timed out we probably don't need to worry about backing
# If we timed out we probably don't need to worry about backing
# off too much, but lets just wait a little anyway.
# off too much, but lets just wait a little anyway.
...
@@ -190,7 +190,9 @@ class ReplicationEndpoint(object):
...
@@ -190,7 +190,9 @@ class ReplicationEndpoint(object):
http_server
.
register_paths
(
method
,
[
pattern
],
handler
)
http_server
.
register_paths
(
method
,
[
pattern
],
handler
)
def
_cached_handler
(
self
,
request
,
txn_id
,
**
kwargs
):
def
_cached_handler
(
self
,
request
,
txn_id
,
**
kwargs
):
"""
Wraps `_handle_request` the responses should be cached.
"""
Called on new incoming requests when caching is enabled. Checks
if their is a cached response for the request and returns that,
otherwise calls `_handle_request` and caches its response.
"""
"""
# We just use the txn_id here, but we probably also want to use the
# We just use the txn_id here, but we probably also want to use the
# other PATH_ARGS as well.
# other PATH_ARGS as well.
...
...
This diff is collapsed.
Click to expand it.
synapse/replication/http/membership.py
+
36
−
0
View file @
50114176
...
@@ -27,6 +27,16 @@ logger = logging.getLogger(__name__)
...
@@ -27,6 +27,16 @@ logger = logging.getLogger(__name__)
class
ReplicationRemoteJoinRestServlet
(
ReplicationEndpoint
):
class
ReplicationRemoteJoinRestServlet
(
ReplicationEndpoint
):
"""
Does a remote join for the given user to the given room
"""
Does a remote join for the given user to the given room
Request format:
POST /_synapse/replication/remote_join/:room_id/:user_id
{
"
requester
"
: ...,
"
remote_room_hosts
"
: [...],
"
content
"
: { ... }
}
"""
"""
NAME
=
"
remote_join
"
NAME
=
"
remote_join
"
...
@@ -85,6 +95,15 @@ class ReplicationRemoteJoinRestServlet(ReplicationEndpoint):
...
@@ -85,6 +95,15 @@ class ReplicationRemoteJoinRestServlet(ReplicationEndpoint):
class
ReplicationRemoteRejectInviteRestServlet
(
ReplicationEndpoint
):
class
ReplicationRemoteRejectInviteRestServlet
(
ReplicationEndpoint
):
"""
Rejects the invite for the user and room.
"""
Rejects the invite for the user and room.
Request format:
POST /_synapse/replication/remote_reject_invite/:room_id/:user_id
{
"
requester
"
: ...,
"
remote_room_hosts
"
: [...],
}
"""
"""
NAME
=
"
remote_reject_invite
"
NAME
=
"
remote_reject_invite
"
...
@@ -153,6 +172,17 @@ class ReplicationRemoteRejectInviteRestServlet(ReplicationEndpoint):
...
@@ -153,6 +172,17 @@ class ReplicationRemoteRejectInviteRestServlet(ReplicationEndpoint):
class
ReplicationRegister3PIDGuestRestServlet
(
ReplicationEndpoint
):
class
ReplicationRegister3PIDGuestRestServlet
(
ReplicationEndpoint
):
"""
Gets/creates a guest account for given 3PID.
"""
Gets/creates a guest account for given 3PID.
Request format:
POST /_synapse/replication/get_or_register_3pid_guest/
{
"
requester
"
: ...,
"
medium
"
: ...,
"
address
"
: ...,
"
inviter_user_id
"
: ...
}
"""
"""
NAME
=
"
get_or_register_3pid_guest
"
NAME
=
"
get_or_register_3pid_guest
"
...
@@ -206,6 +236,12 @@ class ReplicationRegister3PIDGuestRestServlet(ReplicationEndpoint):
...
@@ -206,6 +236,12 @@ class ReplicationRegister3PIDGuestRestServlet(ReplicationEndpoint):
class
ReplicationUserJoinedLeftRoomRestServlet
(
ReplicationEndpoint
):
class
ReplicationUserJoinedLeftRoomRestServlet
(
ReplicationEndpoint
):
"""
Notifies that a user has joined or left the room
"""
Notifies that a user has joined or left the room
Request format:
POST /_synapse/replication/membership_change/:room_id/:user_id/:change
{}
"""
"""
NAME
=
"
membership_change
"
NAME
=
"
membership_change
"
...
...
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