Skip to content

Commit

Permalink
Add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanRosenboim committed Aug 19, 2024
1 parent 213a35a commit fe83ab5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/shared/clients/jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ def get_existing_teams(token: str) -> List[TeamAttributes]:
teams = response_data.get('data', [])
all_teams.extend(teams)
after = response_data.get('metadata', {}).get('after')

logger.info(f"Retrieved {len(teams)} teams.")
if not after:
break # Exit loop if there's no 'after' for the next page
break

# Prepare params for the next request with pagination
params['page'] = after
else:
print(
logger.error(
f"Failed to retrieve teams. Status code: {response.status_code}, {response.text}")
break

Expand Down

0 comments on commit fe83ab5

Please sign in to comment.