Attempt a fix for a race condition in filter-test.py.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 8 Oct 2012 16:46:10 +0000 (12:46 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 8 Oct 2012 16:46:10 +0000 (12:46 -0400)
filter-test.py

index b6f7f2ca54a5a7e502b20eb6a4003803151a943b..6298b91bcfe9988d21641845207d89b027089c2a 100755 (executable)
@@ -23,10 +23,13 @@ ps = subprocess.Popen("ps -U %s uh" % os.getenv("LOGNAME"),
 data = ps.stdout.read()
 irkerd_count = len([x for x in data.split("\n") if x.find("irkerd") != -1])
 
-if not irkerd_count:
+if irkerd_count:
+    sys.stderr.write("Using a running irker instance...")
+else:
+    sys.stderr.write("Launching a new irker instance...")
     os.system("gnome-terminal --title 'irkerd' -e 'irkerd -d 2' &")
 
-time.sleep(0.5)        # Avoid a race condition
+time.sleep(1.5)        # Avoid a race condition
 
 print json.dumps(metadata)
 # end