mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-01-13 15:39:32 -05:00
Rename _fail_fetch_pdu_cache to _get_pdu_cache
This commit is contained in:
parent
964bb43fbe
commit
ec847059f3
@ -275,7 +275,7 @@ def setup():
|
|||||||
hs.get_pusherpool().start()
|
hs.get_pusherpool().start()
|
||||||
hs.get_state_handler().start_caching()
|
hs.get_state_handler().start_caching()
|
||||||
hs.get_datastore().start_profiling()
|
hs.get_datastore().start_profiling()
|
||||||
hs.get_replication_layer().start_pdu_fail_cache()
|
hs.get_replication_layer().start_get_pdu_cache()
|
||||||
|
|
||||||
if config.daemonize:
|
if config.daemonize:
|
||||||
print config.pid_file
|
print config.pid_file
|
||||||
|
@ -32,10 +32,10 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class FederationClient(FederationBase):
|
class FederationClient(FederationBase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._fail_fetch_pdu_cache = None
|
self._get_pdu_cache = None
|
||||||
|
|
||||||
def start_pdu_fail_cache(self):
|
def start_get_pdu_cache(self):
|
||||||
self._fail_fetch_pdu_cache = ExpiringCache(
|
self._get_pdu_cache = ExpiringCache(
|
||||||
cache_name="get_pdu_cache",
|
cache_name="get_pdu_cache",
|
||||||
clock=self._clock,
|
clock=self._clock,
|
||||||
max_len=1000,
|
max_len=1000,
|
||||||
@ -43,7 +43,7 @@ class FederationClient(FederationBase):
|
|||||||
reset_expiry_on_get=False,
|
reset_expiry_on_get=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
self._fail_fetch_pdu_cache.start()
|
self._get_pdu_cache.start()
|
||||||
|
|
||||||
@log_function
|
@log_function
|
||||||
def send_pdu(self, pdu, destinations):
|
def send_pdu(self, pdu, destinations):
|
||||||
@ -175,8 +175,8 @@ class FederationClient(FederationBase):
|
|||||||
|
|
||||||
# TODO: Rate limit the number of times we try and get the same event.
|
# TODO: Rate limit the number of times we try and get the same event.
|
||||||
|
|
||||||
if self._fail_fetch_pdu_cache:
|
if self._get_pdu_cache:
|
||||||
e = self._fail_fetch_pdu_cache.get(event_id)
|
e = self._get_pdu_cache.get(event_id)
|
||||||
if e:
|
if e:
|
||||||
defer.returnValue(e)
|
defer.returnValue(e)
|
||||||
|
|
||||||
@ -223,8 +223,8 @@ class FederationClient(FederationBase):
|
|||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if self._fail_fetch_pdu_cache is not None:
|
if self._get_pdu_cache is not None:
|
||||||
self._fail_fetch_pdu_cache[event_id] = pdu
|
self._get_pdu_cache[event_id] = pdu
|
||||||
|
|
||||||
defer.returnValue(pdu)
|
defer.returnValue(pdu)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user