Exemple #1
0
    def _cb_timeout(response: Response, request: Request, timeout: float,
                    timeout_cl: DelayedCall) -> Response:
        if timeout_cl.active():
            timeout_cl.cancel()
            return response

        url = urldefrag(request.url)[0]
        raise TimeoutError(
            f"Getting {url} took longer than {timeout} seconds.")
Exemple #2
0
 def cancel(self):
     if self.cancelled or self.called:
         self.cancelled = True
         return
     return TwistedDelayedCall.cancel(self)
Exemple #3
0
 def cancel(self):
     if self.cancelled or self.called:
         self.cancelled = True
         return
     return TwistedDelayedCall.cancel(self)