diff --git a/pyrad/client_async.py b/pyrad/client_async.py index 0789371..8f781dd 100644 --- a/pyrad/client_async.py +++ b/pyrad/client_async.py @@ -51,7 +51,7 @@ async def __timeout_handler__(self): for id, req in self.pending_requests.items(): now = datetime.now() - secs = (req['sent_date'] - now).seconds + secs = (now - req['sent_date']).seconds if secs > self.timeout: if req['retries'] == self.retries: self.logger.debug( @@ -72,10 +72,11 @@ async def __timeout_handler__(self): req['retries'] += 1 self.retries_counter += 1 self.logger.debug( - '[%s:%d:%d] For request %d execute retry %d.' % ( + '[%s:%d:%d] For request %d reached %s secs. %s' % ( self.server, self.port, socket.getsockname()[1] if socket else '', - id, req['retries'] + id, secs, + 'I execute retry %d.' % req['retries'] ) )