Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Wire the new ApplicationServiceAgent into the ApplicationServiceApi '…
Browse files Browse the repository at this point in the history
…client'.
  • Loading branch information
realtyem committed Oct 4, 2023
1 parent b04b496 commit 2e12ac0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions synapse/appservice/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
)
from synapse.events import EventBase
from synapse.events.utils import SerializeEventConfig, serialize_event
from synapse.http.client import SimpleHttpClient, is_unknown_endpoint
from synapse.http.appserviceagent import ApplicationServiceAgent
from synapse.http.client import BaseHttpClient, is_unknown_endpoint
from synapse.logging import opentracing
from synapse.types import DeviceListUpdates, JsonDict, JsonMapping, ThirdPartyInstanceID
from synapse.util.caches.response_cache import ResponseCache
Expand Down Expand Up @@ -112,7 +113,7 @@ def _is_valid_3pe_result(r: object, field: str) -> TypeGuard[JsonDict]:
return True


class ApplicationServiceApi(SimpleHttpClient):
class ApplicationServiceApi(BaseHttpClient):
"""This class manages HS -> AS communications, including querying and
pushing.
"""
Expand All @@ -122,6 +123,12 @@ def __init__(self, hs: "HomeServer"):
self.clock = hs.get_clock()
self.config = hs.config.appservice

# TODO: Do we want an HttpConnectionPool for this?
self.agent: ApplicationServiceAgent = ApplicationServiceAgent(
self.reactor,
self.hs.get_http_client_context_factory(),
)

self.protocol_meta_cache: ResponseCache[Tuple[str, str]] = ResponseCache(
hs.get_clock(), "as_protocol_meta", timeout_ms=HOUR_IN_MS
)
Expand Down

0 comments on commit 2e12ac0

Please sign in to comment.