svc/conntrack.in: Keep the D-Bus monitor alive.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 15 May 2010 18:29:06 +0000 (19:29 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 15 May 2010 18:29:06 +0000 (19:29 +0100)
Turns out nothing actually tried to keep the monitor alive.  After a
(rather random) interval, the bus just got dropped and we didn't get
any more notifications from anyone.

Stash it in a global variable.

svc/conntrack.in

index eabdc2b..18e2f73 100644 (file)
@@ -457,12 +457,13 @@ def init():
   Add the D-Bus monitor here, because we might send commands off immediately,
   and we want to make sure the server connection is up.
   """
+  global DBM
   T.Coroutine(kickpeers, name = 'kickpeers').switch()
-  dbm = DBusMonitor()
-  dbm.addmon(NetworkManagerMonitor())
-  dbm.addmon(MaemoICdMonitor())
-  G.timeout_add_seconds(300, lambda: (netupdown(True, ['interval-timer'])
-                                      or True))
+  DBM = DBusMonitor()
+  DBM.addmon(NetworkManagerMonitor())
+  DBM.addmon(MaemoICdMonitor())
+  G.timeout_add_seconds(30, lambda: (netupdown(True, ['interval-timer'])
+                                     or True))
 
 def parse_options():
   """