Skip to content

Commit

Permalink
clean up uris, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Richelson committed Jul 2, 2016
1 parent b6b4151 commit 40f5443
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions ldclient/client.py
Expand Up @@ -64,9 +64,8 @@ def __init__(self,

self.base_uri = base_uri.rstrip('\\')
self.get_latest_features_uri = self.base_uri + GET_LATEST_FEATURES_PATH
self.events_uri = events_uri.rstrip('\\')
self.stream_uri = stream_uri.rstrip('\\')
self.stream_features_uri = self.stream_uri + STREAM_FEATURES_PATH
self.events_uri = events_uri.rstrip('\\') + '/bulk'
self.stream_uri = stream_uri.rstrip('\\') + STREAM_FEATURES_PATH

if update_processor_class:
self.update_processor_class = update_processor_class
Expand Down
2 changes: 1 addition & 1 deletion ldclient/event_consumer.py
Expand Up @@ -43,7 +43,7 @@ def do_send(should_retry):
else:
body = events
hdrs = _headers(self._api_key)
uri = self._config.events_uri + '/bulk'
uri = self._config.events_uri
r = self._session.post(uri, headers=hdrs, timeout=(self._config.connect, self._config.read_timeout),
data=json.dumps(body))
r.raise_for_status()
Expand Down
2 changes: 1 addition & 1 deletion ldclient/streaming.py
Expand Up @@ -22,7 +22,7 @@ def run(self):
log.debug("Starting StreamingUpdateProcessor")
self._running = True
hdrs = _stream_headers(self._api_key)
uri = self._config.stream_features_uri
uri = self._config.stream_uri
messages = SSEClient(uri, verify=self._config.verify_ssl, headers=hdrs)
for msg in messages:
if not self._running:
Expand Down
7 changes: 4 additions & 3 deletions ldclient/twisted_impls.py
Expand Up @@ -71,7 +71,7 @@ def close(self):
def __init__(self, api_key, config, store, requester):
self._store = store
self._requester = requester
self.sse_client = TwistedSSEClient(config.stream_features_uri,
self.sse_client = TwistedSSEClient(config.stream_uri,
headers=_stream_headers(api_key, "PythonTwistedClient"),
verify_ssl=config.verify_ssl,
on_event=partial(StreamingUpdateProcessor.process_message,
Expand Down Expand Up @@ -144,8 +144,9 @@ def do_send(should_retry):
else:
body = events
hdrs = _headers(self._api_key)
uri = self._config.events_uri + '/bulk'
r = yield self._session.post(uri, headers=hdrs, timeout=(self._config.connect, self._config.read),
r = yield self._session.post(self._config.events_uri,
headers=hdrs,
timeout=(self._config.connect, self._config.read),
data=json.dumps(body))
r.raise_for_status()
except ProtocolError as e:
Expand Down
2 changes: 1 addition & 1 deletion redis-requirements.txt
@@ -1 +1 @@
redis>=2.10
redis>=2.10.5
3 changes: 1 addition & 2 deletions requirements.txt
@@ -1,5 +1,4 @@
CacheControl>=0.10.2
requests>=2.4.0
future>=0.14.3
sseclient>=0.0.9
redis>=2.10.5
sseclient>=0.0.9

0 comments on commit 40f5443

Please sign in to comment.