forked from p15670423/monkey
island: Log a warning if MongoDbProcess.stop() is erroniously called
This commit is contained in:
parent
e80ac4c943
commit
cc1865dc5b
|
@ -36,9 +36,13 @@ class MongoDbProcess:
|
||||||
logger.info("MongoDB launched successfully!")
|
logger.info("MongoDB launched successfully!")
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
if self._process:
|
if not self._process:
|
||||||
|
logger.warning("Failed to stop MongoDB process: No process found")
|
||||||
|
return
|
||||||
|
|
||||||
logger.info("Terminating MongoDB process")
|
logger.info("Terminating MongoDB process")
|
||||||
self._process.terminate()
|
self._process.terminate()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self._process.wait(timeout=TERMINATE_TIMEOUT)
|
self._process.wait(timeout=TERMINATE_TIMEOUT)
|
||||||
logger.info("MongoDB process terminated successfully")
|
logger.info("MongoDB process terminated successfully")
|
||||||
|
|
Loading…
Reference in New Issue