Better logging for multiple instances running.

This commit is contained in:
Martyn Inglis
2017-02-08 16:35:09 +00:00
parent 703e12e516
commit a7cfaf3f13

View File

@@ -57,9 +57,7 @@ def pid_still_running(pid):
Once the process stops this file no longer exists. Slim possibilty of a race condition here. Once the process stops this file no longer exists. Slim possibilty of a race condition here.
""" """
if os.path.exists("/proc/" + pid): return os.path.exists("/proc/" + pid)
return True
return False
if __name__ == "__main__": if __name__ == "__main__":
@@ -78,6 +76,6 @@ if __name__ == "__main__":
""" """
iteration = 0 iteration = 0
while pid_still_running(celery_pid) and iteration < 180: while pid_still_running(celery_pid) and iteration < 180:
print("waited for ", iteration * 5, " secs") print("[", celery_pid_file, "] waited for ", iteration * 5, " secs")
sleep(5) sleep(5)
iteration += 1 iteration += 1