mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-16 10:12:32 -05:00
Better logging for multiple instances running.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user