chiark / gitweb /
svc/connect.in: Only check the configuration database once a minute.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 20 Jul 2014 12:50:28 +0000 (13:50 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 20 Jul 2014 13:56:54 +0000 (14:56 +0100)
I think this is quite often enough, and more is likely to drain the
battery of mobile devices unacceptably.

svc/connect.in

index 000ca50eba511232b1ae82dd3d7af613b1b33797..8abe108ac375b1cb0ba9fe2526cdb3f1b3f6da89 100644 (file)
@@ -127,7 +127,7 @@ class ErrorWatch (T.Coroutine):
 
 def dbwatch():
   """
-  Coroutine function: wake up every second and notice changes to the
+  Coroutine function: wake up every minute and notice changes to the
   database.  When a change happens, tell the Pinger (q.v.) to rescan its
   peers.
   """
@@ -135,7 +135,7 @@ def dbwatch():
   main = cr.parent
   fw = M.FWatch(opts.cdb)
   while True:
-    timer = M.SelTimer(time() + 1, lambda: cr.switch())
+    timer = M.SelTimer(time() + 60, lambda: cr.switch())
     main.switch()
     if fw.update():
       pinger.rescan(False)