Skip to content

Commit

Permalink
Fix core exitcallback called multiple times
Browse files Browse the repository at this point in the history
Signed-off-by: Loren Eteval <loren.eteval@proton.me>
  • Loading branch information
LorenEteval committed Oct 18, 2023
1 parent 9c62248 commit 19918b5
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions Furious/Core/Core.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,25 @@ def isAlive(self):
return False

def checkAlive(self):
assert isinstance(self._process, multiprocessing.Process)
if isinstance(self._process, multiprocessing.Process):
if self._process.is_alive():
return True
else:
logger.error(
f'{self.name()} stopped unexpectedly with exitcode {self._process.exitcode}'
)

if self._process.is_alive():
return True
else:
logger.error(
f'{self.name()} stopped unexpectedly with exitcode {self._process.exitcode}'
)
self._stdoutTimer.stop()
self._daemonTimer.stop()

self._stdoutTimer.stop()
self._daemonTimer.stop()
if callable(self._exitCallback):
self._exitCallback(self._process.exitcode)

if callable(self._exitCallback):
self._exitCallback(self._process.exitcode)
# Reset internal process
self._process = None

return False
else:
return False

def start(self, *args, **kwargs):
Expand Down

0 comments on commit 19918b5

Please sign in to comment.