Skip to content

Commit 46dc75b

Browse files
committed
[UPT][#34] Remove extra wait time from PRD environment.
1 parent 19aa645 commit 46dc75b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

api/src/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222

2323
@app.get("/{username}/{information}")
2424
async 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"

0 commit comments

Comments
 (0)