mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 02:44:53 -04:00
Copypasta the 3PU support code to also do 3PL
This commit is contained in:
parent
f3afd6ef1a
commit
06964c4a0a
3 changed files with 61 additions and 3 deletions
|
@ -82,6 +82,17 @@ class ApplicationServiceApi(SimpleHttpClient):
|
|||
logger.warning("query_3pu to %s threw exception %s", uri, ex)
|
||||
defer.returnValue([])
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def query_3pl(self, service, protocol, fields):
|
||||
uri = service.url + ("/3pl/%s" % urllib.quote(protocol))
|
||||
response = None
|
||||
try:
|
||||
response = yield self.get_json(uri, fields)
|
||||
defer.returnValue(response)
|
||||
except Exception as ex:
|
||||
logger.warning("query_3pl to %s threw exception %s", uri, ex)
|
||||
defer.returnValue([])
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def push_bulk(self, service, events, txn_id=None):
|
||||
events = self._serialize(events)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue