#2 added a way to relaunch a cellxgene server

This commit is contained in:
Alok Saldanha
2019-09-17 10:13:20 -04:00
parent a6c9456786
commit 2b259ab6b5
4 changed files with 22 additions and 19 deletions
+1 -10
View File
@@ -19,15 +19,6 @@ class PruneProcessCache:
def __init__(self, cache):
self.cache = cache
def prune(self, process):
self.cache.entry_list.remove(process)
pid = process.pid
if pid != None:
p = psutil.Process(pid)
p.terminate()
p = psutil.Process(pid + 2)
p.terminate()
def __call__(self):
while True:
time.sleep(60)
@@ -42,7 +33,7 @@ class PruneProcessCache:
for process in processes_to_delete:
try:
self.prune(process)
cache.prune(process)
except Exception as detail:
print('failed to prune process:', detail)