Skip to content

Commit

Permalink
contributor: skip requesting GitHub API when env DEV exists
Browse files Browse the repository at this point in the history
GitHub API has rate limit when not logined, and it's easy to reach that when debugging locally.
  • Loading branch information
taoky committed Mar 12, 2023
1 parent 2aeeb2d commit 5f1c33d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@


def get_api():
if os.environ.get("DEV"):
return [
{
"login": "(名单生成已跳过)"
}
]
req = urllib.request.urlopen("https://api.github.com/repos/ustclug/mirrorhelp/contributors")
return json.load(req)

Expand Down

0 comments on commit 5f1c33d

Please sign in to comment.