Skip to content

Commit

Permalink
response handler bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
realiti4 committed Mar 14, 2021
1 parent cb53163 commit f36ae17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tradingfeatures/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def response_handler(self, address, params, timeout=60):
retry_after += int(r.headers['Retry-After'])

print(f'\nResponse: {r.status_code}, trying after {retry_after}secs')
print(r.json())
try:
print(r.json())
except:
pass
# r.raise_for_status()
time.sleep(retry_after)

Expand Down
2 changes: 1 addition & 1 deletion tradingfeatures/uber.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def eval_get(self, limit=1000, **kwargs):
datasets = []

for api in self.apis:
df = api.get().set_index('timestamp')
df = api.get()
df = df[-limit:]
datasets.append([api.name, df])

Expand Down

0 comments on commit f36ae17

Please sign in to comment.