positive note, wait to finish

This commit is contained in:
Sander Land committed 2020-11-02 20:48:01 +01:00
1 parent 162aa8501f
commit 88d8decaa5
5 files changed
+11 -7

No files matched your search

+5 -2
View File
@@ -134,11 +134,14 @@ class KataGoEngine:
raise EngineDiedException(died_msg)
return ok
def wait_to_finish(self):
while self.queries and self.katago_process and self.katago_process.poll() is None:
time.sleep(0.1)
def shutdown(self, finish=False):
process = self.katago_process
if finish and process:
while self.queries and process.poll() is None:
time.sleep(0.1)
self.wait_to_finish()
if process:
self.katago_process = None
process.terminate()