Skip to content

Commit 3222697

Browse files
authored
set GitHub stars default during app build (#1182)
Co-authored-by: pourhakimi <[email protected]>
1 parent 5ecc395 commit 3222697

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pcweb/github.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
import reflex as rx
77
import contextlib
88

9-
REFLEX_STAR_COUNT = 0
109
GITHUB_API_URL = "https://api.github.com/repos/reflex-dev/reflex"
1110

1211

12+
def get_stars_on_build():
13+
"""Fetch the stars when app is built as default"""
14+
data = httpx.get(GITHUB_API_URL).json()
15+
return int(data["stargazers_count"])
16+
17+
18+
REFLEX_STAR_COUNT = get_stars_on_build()
19+
20+
1321
async def fetch_count():
1422
"""Fetch the stars count of the reflex repository."""
1523
try:

0 commit comments

Comments
 (0)