From d53d8dcb8bf9f52abdc0f408bddf52ba688d0290 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 8 Oct 2012 12:46:10 -0400 Subject: [PATCH] Attempt a fix for a race condition in filter-test.py. --- filter-test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/filter-test.py b/filter-test.py index b6f7f2c..6298b91 100755 --- a/filter-test.py +++ b/filter-test.py @@ -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 -- 2.26.2