summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--voctocore/lib/controlserver.py10
-rw-r--r--voctogui/lib/connection.py5
2 files changed, 6 insertions, 9 deletions
diff --git a/voctocore/lib/controlserver.py b/voctocore/lib/controlserver.py
index 2dc6e1c..016d20c 100644
--- a/voctocore/lib/controlserver.py
+++ b/voctocore/lib/controlserver.py
@@ -55,9 +55,8 @@ class ControlServer(TCPMultiConnection):
self.close_connection(conn)
return False
- if self.command_queue.empty():
- self.log.debug('command_queue was empty, re-starting on_loop scheduling')
- GObject.idle_add(self.on_loop)
+ self.log.debug('re-starting on_loop scheduling')
+ GObject.idle_add(self.on_loop)
self.command_queue.put((line, conn))
@@ -135,9 +134,8 @@ class ControlServer(TCPMultiConnection):
def _schedule_write(self, conn, message):
queue = self.currentConnections[conn]
- if queue.empty():
- self.log.debug('write_queue[%u] was empty, re-starting on_write scheduling', conn.fileno())
- GObject.io_add_watch(conn, GObject.IO_OUT, self.on_write)
+ self.log.debug('re-starting on_write scheduling', conn.fileno())
+ GObject.io_add_watch(conn, GObject.IO_OUT, self.on_write)
queue.put(message)
diff --git a/voctogui/lib/connection.py b/voctogui/lib/connection.py
index 2a6aaf5..71c6588 100644
--- a/voctogui/lib/connection.py
+++ b/voctogui/lib/connection.py
@@ -79,9 +79,8 @@ def on_data(conn, _, leftovers, *args):
log.debug("got line: %r", line)
line = line.strip()
- if command_queue.empty():
- log.debug('command_queue was empty, re-starting on_loop scheduling')
- GObject.idle_add(on_loop)
+ log.debug('re-starting on_loop scheduling')
+ GObject.idle_add(on_loop)
command_queue.put((line, conn))