File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,7 +146,8 @@ def get_rest_hosts(self):
146146 if host is None :
147147 return hosts
148148
149- if time .time () > self .__host_expires :
149+ # unstore saved fallback host after fallbackRetryTimeout (RSC15f)
150+ if self .__host_expires is not None and time .time () > self .__host_expires :
150151 self .__host = None
151152 self .__host_expires = None
152153 return hosts
Original file line number Diff line number Diff line change 1+ from ably import AblyRest
2+
3+
4+ def test_http_get_rest_hosts_works_when_fallback_realtime_host_is_set ():
5+ ably = AblyRest (token = "foo" )
6+ ably .options .fallback_realtime_host = ably .options .get_rest_hosts ()[0 ]
7+ assert ably .http .get_rest_hosts ()
8+
9+
10+ def test_http_get_rest_hosts_works_when_fallback_realtime_host_is_not_set ():
11+ ably = AblyRest (token = "foo" )
12+ ably .options .fallback_realtime_host = None
13+ assert ably .http .get_rest_hosts ()
You can’t perform that action at this time.
0 commit comments