mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-26 07:39:22 +02:00
Predictor.shutdown: use join() instead of terminate()
This commit is contained in:
parent
ffe5cdc519
commit
9efce5e9f2
1 changed files with 4 additions and 3 deletions
|
|
@ -194,17 +194,18 @@ class Predictor(mp.context.SpawnProcess):
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
# do not terminate from forked processor instances
|
# do not terminate from forked processor instances
|
||||||
if mp.parent_process() is None:
|
if not hasattr(self, 'model'):
|
||||||
self.stopped.set()
|
self.stopped.set()
|
||||||
|
self.join()
|
||||||
self.taskq.close()
|
self.taskq.close()
|
||||||
self.taskq.cancel_join_thread()
|
self.taskq.cancel_join_thread()
|
||||||
self.resultq.close()
|
self.resultq.close()
|
||||||
self.resultq.cancel_join_thread()
|
self.resultq.cancel_join_thread()
|
||||||
self.logq.close()
|
self.logq.close()
|
||||||
self.terminate()
|
#self.terminate()
|
||||||
else:
|
else:
|
||||||
del self.model
|
del self.model
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
#self.logger.debug(f"deinit of {self} in {mp.current_process().name}")
|
#self.logger.debug(f"deinit of {self.name} in {mp.current_process().name}")
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue