mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-27 11:58:53 -06:00
refactor: move profile_sync logic into profiling
This commit is contained in:
1 parent
22a81c384d
commit
75a69a4a42
13 files changed
+366
-300
No files matched your search
@@ -0,0 +1,23 @@
|
||||
"""The anonymous GitHub quota a profile pass has to fit in."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
from core.github import github_token
|
||||
|
||||
ANON_QUOTA = 60
|
||||
|
||||
|
||||
def check_quota(count: int, offline: bool) -> None:
|
||||
"""Refuse a run the anonymous quota cannot carry to completion."""
|
||||
if offline or github_token():
|
||||
return
|
||||
if count * 5 > ANON_QUOTA:
|
||||
print(
|
||||
f"{count} profiles need roughly {count * 5} API calls, the anonymous "
|
||||
f"quota is {ANON_QUOTA} per hour. Log in with `gh auth login`, set "
|
||||
"GITHUB_TOKEN, or use --offline.",
|
||||
file=sys.stderr,
|
||||
)
|
||||
raise SystemExit(1)
|
||||
Reference in new issue
Block a user