(self)
Refresh subscription information in Redis for GitHub bot to load.
Refresh subscription information in Redis for GitHub bot to load.
Refresh subscription information in Redis for GitHub bot to load .
def update_bot(self) -> None:
        """
        Refresh subscription information in Redis for GitHub bot to load.
        """
        key = f"kodiak:subscription:{self.github_installation_id}".encode()

        r.hset(key, b"account_id", str(self.id))

        subscription_blocker = self.get_subscription_blocker()
        if subscription_blocker:
            r.hset(key, b"subscription_blocker", subscription_blocker.kind.encode())
            r.hset(key, b"data", subscription_blocker.json())
        else:
            r.hset(key, b"subscription_blocker", b"")
            r.hset(key, b"data", b"")

        # Trigger bot to reevaluate pull request mergeability.
        # We can use this to trigger the bot to remove the paywall status message on upgrades.

        class RefreshPullRequestsMessage(pydantic.BaseModel):
            installation_id: str

        r.rpush(
            "kodiak:refresh_pull_requests_for_installation",
            RefreshPullRequestsMessage(
                installation_id=str(self.github_installation_id)
            ).json(),
        )
def update_bot ( self ) -> None : key = f"kodiak:subscription:{self.github_installation_id}" . encode ( ) r . hset ( key , b"account_id" , str ( self . id ) ) subscription_blocker = self . get_subscription_blocker ( ) if subscription_blocker : r . hset ( key , b"subscription_blocker" , subscription_blocker . kind . encode ( ) ) r . hset ( key , b"data" , subscription_blocker . json ( ) ) else : r . hset ( key , b"subscription_blocker" , b"" ) r . hset ( key , b"data" , b"" ) # Trigger bot to reevaluate pull request mergeability. # We can use this to trigger the bot to remove the paywall status message on upgrades. class RefreshPullRequestsMessage ( pydantic . BaseModel ) : installation_id : str r . rpush ( "kodiak:refresh_pull_requests_for_installation" , RefreshPullRequestsMessage ( installation_id = str ( self . github_installation_id ) ) . json ( ) , )