Skip to content

Commit

Permalink
Merge pull request #1 from blockchain-etl/bug/memory_leak_in_rpc
Browse files Browse the repository at this point in the history
Fix memory leak in request.py
  • Loading branch information
medvedev1088 committed Aug 27, 2020
2 parents c7e1575 + e2b79cf commit 166ce8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tezosetl/rpc/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def make_post_request(endpoint_uri, data, *args, **kwargs):
return response.content


def make_get_request(endpoint_uri, *args, **kwargs):
def make_get_request(url, path, *args, **kwargs):
kwargs.setdefault('timeout', 10)
session = _get_session(endpoint_uri)
response = session.get(endpoint_uri, *args, **kwargs)
session = _get_session(url)
response = session.get(url + path, *args, **kwargs)
response.raise_for_status()

return response.content
3 changes: 2 additions & 1 deletion tezosetl/rpc/tezos_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def __init__(self, provider_uri, timeout=60):

def get(self, endpoint):
raw_response = make_get_request(
self.provider_uri + endpoint,
self.provider_uri,
endpoint,
timeout=self.timeout
)

Expand Down

0 comments on commit 166ce8c

Please sign in to comment.