Files
esefandClaude Opus 5.5 d514601651 firebase_website: drop the sysinfo sync to Firestore
The website bot status tab was replaced by the VEGA status page, so
nothing reads sysinfo/server anymore. get_db() stays for calendar and
bucketlist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 15:23:41 +03:00

27 lines
808 B
Python

"""Firebase project config + shared Admin SDK client."""
######################################################################
import logging
import os
from google.cloud.firestore import AsyncClient
log = logging.getLogger(__name__)
PROJECT_ID = "esef-514bf"
_db: AsyncClient | None = None
def get_db() -> AsyncClient:
"""Return the shared Firestore AsyncClient, creating it on first call."""
global _db
if _db 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(project=PROJECT_ID)
log.info("Firestore Admin SDK initialised (project %s)", _db.project)
return _db