Small refactoring

This commit is contained in:
Vasily Evseenko 2019-11-12 00:14:04 +03:00
parent b0b88d7ac3
commit 5474bf9122

View File

@ -58,8 +58,8 @@ class UDPProxyProtocol(DatagramProtocol):
def flush_queue(self):
if self.agg_queue_size > 0:
if self.agg_queue_timer is not None:
if not self.agg_queue_timer.called:
if self.agg_queue_timer is not None \
and not self.agg_queue_timer.called:
self.agg_queue_timer.cancel()
self.agg_queue_timer = None
self._send_to_peer(b''.join(self.agg_queue))