Skip to content

Commit

Permalink
[sc-98469] displaying request number in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbourret committed Aug 31, 2022
1 parent 0ac98a9 commit 7475df5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python-lib/rest_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(self, credential, endpoint, custom_key_values={}):
key_value_body = endpoint.get("key_value_body", {})
self.requests_kwargs.update({"json": get_dku_key_values(key_value_body)})
self.metadata = {}
self.call_number = 0

def set_login(self, credential):
login_type = credential.get("login_type", "no_auth")
Expand Down Expand Up @@ -167,6 +168,8 @@ def paginated_api_call(self, can_raise_exeption=True):
params = self.requests_kwargs.get("params")
params.update(pagination_params)
self.requests_kwargs.update({"params": params})
self.call_number = self.call_number + 1
logger.info("API call number #{}".format(self.call_number))
return self.request(self.http_method, self.pagination.get_next_page_url(), can_raise_exeption, **self.requests_kwargs)

def empty_json_response(self):
Expand Down

0 comments on commit 7475df5

Please sign in to comment.