cc-4105: added docstrings and fixed code formatting
This commit is contained in:
parent
a73d0940bd
commit
0b872afe59
2 changed files with 13 additions and 6 deletions
|
@ -9,11 +9,11 @@ class EventDrainer(Loggable):
|
|||
"""
|
||||
def __init__(self, connection, interval=1):
|
||||
def cb():
|
||||
try: connection.drain_events(timeout=0.3)
|
||||
except socket.timeout: pass
|
||||
except Exception as e:
|
||||
self.logger.error("Error flushing events")
|
||||
self.logger.error( str(e) )
|
||||
t = RepeatTimer(interval, cb)
|
||||
try : connection.drain_events(timeout=0.3)
|
||||
except socket.timeout : pass
|
||||
except Exception as e :
|
||||
self.fatal_exception("Error flushing events", e)
|
||||
|
||||
t = RepeatTimer(interval, cb)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue