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
Package registry
Container Registry
Model registry
Operate
Terraform modules
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
Timo Ley
synapse
Commits
a1a4960b
Commit
a1a4960b
authored
10 years ago
by
Kegan Dougal
Browse files
Options
Downloads
Patches
Plain Diff
Impl push_bulk function
parent
543e84fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/appservice/api.py
+18
-1
18 additions, 1 deletion
synapse/appservice/api.py
synapse/handlers/appservice.py
+1
-1
1 addition, 1 deletion
synapse/handlers/appservice.py
with
19 additions
and
2 deletions
synapse/appservice/api.py
+
18
−
1
View file @
a1a4960b
...
...
@@ -64,8 +64,25 @@ class ApplicationServiceApi(SimpleHttpClient):
return
logger
.
warning
(
"
query_alias to %s received %s
"
,
uri
,
e
.
code
)
@defer.inlineCallbacks
def
push_bulk
(
self
,
service
,
events
):
pass
uri
=
service
.
url
+
(
"
/transactions/%s
"
%
urllib
.
quote
(
str
(
0
)))
# TODO txn_ids
response
=
None
try
:
response
=
yield
self
.
put_json
(
uri
,
{
"
events
"
:
events
},
{
"
access_token
"
:
self
.
hs_token
})
if
response
:
# just an empty json object
defer
.
returnValue
(
True
)
except
CodeMessageException
as
e
:
logger
.
warning
(
"
push_bulk to %s received %s
"
,
uri
,
e
.
code
)
defer
.
returnValue
(
False
)
@defer.inlineCallbacks
def
push
(
self
,
service
,
event
):
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/appservice.py
+
1
−
1
View file @
a1a4960b
...
...
@@ -56,7 +56,7 @@ class ApplicationServicesHandler(object):
yield
self
.
store
.
update_app_service
(
app_service
)
logger
.
info
(
"
Sending ping to %s...
"
,
app_service
.
url
)
yield
self
.
appservice_api
.
query_alias
(
app_service
,
"
ping
"
)
yield
self
.
appservice_api
.
push
(
app_service
,
"
ping
er
"
)
def
unregister
(
self
,
token
):
logger
.
info
(
"
Unregister as_token=%s
"
,
token
)
...
...
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