From 3b08436fdc8b1aff22591cbaa371fc76d9e9a306 Mon Sep 17 00:00:00 2001 From: Louis-Francis Ratté-Boulianne Date: Thu, 21 Oct 2010 17:13:20 -0400 Subject: bugfix: use timeout_add_seconds instead of timeout_add (Might) avoid some useless wake-up --- butterfly/connection_manager.py | 2 +- telepathy-butterfly | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/butterfly/connection_manager.py b/butterfly/connection_manager.py index c85f95d..dddf31b 100644 --- a/butterfly/connection_manager.py +++ b/butterfly/connection_manager.py @@ -80,7 +80,7 @@ class ButterflyConnectionManager(telepathy.server.ConnectionManager): self._shutdown() return False result = telepathy.server.ConnectionManager.disconnected(self, conn) - gobject.timeout_add(5000, shutdown) + gobject.timeout_add_seconds(5, shutdown) def quit(self): "Terminates all connections. Must be called upon quit" diff --git a/telepathy-butterfly b/telepathy-butterfly index da64c55..75e8332 100755 --- a/telepathy-butterfly +++ b/telepathy-butterfly @@ -53,7 +53,7 @@ from butterfly.util.decorator import async logger = logging.getLogger('Butterfly') -IDLE_TIMEOUT = 5000 +IDLE_TIMEOUT = 5 PROCESS_NAME = 'telepathy-butterfly' if __name__ == '__main__': @@ -92,7 +92,7 @@ if __name__ == '__main__': logger.info('No connection received - quitting') quit() return False - gobject.timeout_add(IDLE_TIMEOUT, timeout_cb) + gobject.timeout_add_seconds(IDLE_TIMEOUT, timeout_cb) shutdown_callback = quit else: shutdown_callback = None -- cgit v1.2.3