clean up firebase_website: offload cpu_percent to thread, cache fastfetch, fix regex, drop processes
This commit is contained in:
1 parent
ab3265667c
commit
7c2fd2a1ac
3 files changed
+86
-46
No files matched your search
@@ -17,12 +17,11 @@ def get_db() -> AsyncClient:
|
||||
"""Return the shared Firestore AsyncClient, creating it on first call."""
|
||||
global _db
|
||||
if _db is None:
|
||||
creds_path = os.getenv("GOOGLE_APPLICATION_CREDENTIALS")
|
||||
if creds_path is None:
|
||||
if not os.getenv("GOOGLE_APPLICATION_CREDENTIALS"):
|
||||
raise RuntimeError(
|
||||
"GOOGLE_APPLICATION_CREDENTIALS is not set. "
|
||||
"Point it to your service-account JSON file."
|
||||
)
|
||||
_db = AsyncClient()
|
||||
_db = AsyncClient(project=PROJECT_ID)
|
||||
log.info("Firestore Admin SDK initialised (project %s)", _db.project)
|
||||
return _db
|
||||
Reference in new issue
Block a user