hgext/inotify/server.py
branchstable
changeset 10494 08064db9f005
parent 10282 08a0f04b56bd
child 11545 db9d16233787
--- a/hgext/inotify/server.py	Wed Feb 17 20:30:57 2010 +0100
+++ b/hgext/inotify/server.py	Wed Feb 17 20:44:49 2010 +0100
@@ -19,6 +19,8 @@
 
 class AlreadyStartedException(Exception):
     pass
+class TimeoutException(Exception):
+    pass
 
 def join(a, b):
     if a:
@@ -444,9 +446,11 @@
 master = _server.master
 
 def start(ui, dirstate, root, opts):
-    timeout = opts.get('timeout')
+    timeout = opts.get('idle_timeout')
     if timeout:
-        timeout = float(timeout) * 1e3
+        timeout = float(timeout) * 60000
+    else:
+        timeout = None
 
     class service(object):
         def init(self):
@@ -457,7 +461,10 @@
 
         def run(self):
             try:
-                self.master.run()
+                try:
+                    self.master.run()
+                except TimeoutException:
+                    pass
             finally:
                 self.master.shutdown()