INNER CODE UNIT · Python

get_github_token

sunithvs/devb.io · config/settings.py:56

    def get_github_token(cls):
        """
        Retrieve and rotate GitHub API tokens in a thread-safe manner.

        Returns:
            str: A GitHub API token
        """
        with cls._lock:
            if not cls._GITHUB_API_TOKENS:
                raise ValueError("No GitHub API tokens configured")

            token = cls._GITHUB_API_TOKENS[cls._github_token_index]
            cls._github_token_index = (cls._github_token_index + 1) % len(cls._GITHUB_API_TOKENS)
            return token

    @classmethod
    def get_groq_key(cls):
        """

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…