Skip to content

Commit d82b57e

Browse files
authored
Merge pull request #36 from ArielMAJ/fix/#34/sleep-timer
Fix/#34/sleep timer
2 parents 19aa645 + 7b01bd6 commit d82b57e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

api/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "api"
3-
version = "0.4.2"
3+
version = "0.4.3"
44
description = ""
55
authors = ["ArielMAJ <ariel.maj@hotmail.com>"]
66
readme = "README.md"

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"

vue-front/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "GitHub_Viz",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

0 commit comments

Comments
 (0)