Esempio n. 1
0
 def UpdateSession(
         self,
         request: UpdateSessionRequest,
         context,
 ) -> UpdateSessionResponse:
     """
     On UpdateSession, return an arbitrarily large amount of additional
     credit for the session.
     """
     logging.debug('Updating sessions')
     resp = UpdateSessionResponse()
     for credit_usage_update in request.updates:
         resp.responses.extend(
             [self._get_credit_update_response(credit_usage_update.sid)],
         )
     return resp
Esempio n. 2
0
    def UpdateSession(
        self,
        request: UpdateSessionRequest,
        context,
    ) -> UpdateSessionResponse:
        """
        On UpdateSession, return an arbitrarily large amount of additional
        credit for the session.

        NOTE: This really shouldn't be called, as no credit should have been
        granted on CreateSession.
        """
        logging.info('UpdateSession called')
        resp = UpdateSessionResponse()
        for credit_usage_update in request.updates:
            resp.responses.extend(self._get_credits(credit_usage_update.sid), )
        return resp