File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222
2323@app .get ("/{username}/{information}" )
2424async def data (username : str , information : str ):
25- await asyncio .sleep (random () * 5 )
26- gh_repositories = get_paginated_data (username )
25+ gh_repositories = await get_paginated_data (username )
2726 return calc_repo_info_for_plotly (gh_repositories , information )
2827
2928
@@ -48,14 +47,15 @@ def calc_repo_info_for_plotly(gh_repositories, information: str):
4847 ]
4948
5049
51- def get_paginated_data (username : str ):
50+ async def get_paginated_data (username : str ):
5251 def parse_data (data ):
5352 if data is None :
5453 return []
5554 return data
5655
5756 if get_settings ().ENVIRONMENT == "DEV" :
5857 logger .debug ("DEV MODE" )
58+ await asyncio .sleep (random () * 5 )
5959 return GH_REPOSITORIES
6060
6161 url = f"https://api.github.com/users/{ username } /repos"
You can’t perform that action at this time.
0 commit comments