mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-16 16:25:20 +02:00
[core] NodeChunk: Do not raise an error when we stop a chunk that is not running
When we stop the process of a node with multiple chunks, the Node function will call the stop function of each chunk. So, the chunck status could be SUBMITTED, RUNNING or ERROR.
This commit is contained in:
parent
008d6c75ee
commit
44ec6f0be7
1 changed files with 15 additions and 1 deletions
|
@ -535,8 +535,22 @@ class NodeChunk(BaseObject):
|
||||||
def stopProcess(self):
|
def stopProcess(self):
|
||||||
if self.isExtern():
|
if self.isExtern():
|
||||||
raise ValueError("Cannot stop process: node is computed externally (another instance of Meshroom)")
|
raise ValueError("Cannot stop process: node is computed externally (another instance of Meshroom)")
|
||||||
|
|
||||||
|
# Ensure that we are up-to-date
|
||||||
|
self.updateStatusFromCache()
|
||||||
|
|
||||||
if self._status.status != Status.RUNNING:
|
if self._status.status != Status.RUNNING:
|
||||||
raise ValueError(f"Cannot stop process: node is not running (status is: {self._status.status}).")
|
# When we stop the process of a node with multiple chunks, the Node function will call the stop function of each chunk.
|
||||||
|
# So, the chunck status could be SUBMITTED, RUNNING or ERROR.
|
||||||
|
|
||||||
|
if self._status.status is Status.SUBMITTED:
|
||||||
|
self.upgradeStatusTo(Status.NONE)
|
||||||
|
elif self._status.status in (Status.ERROR, Status.STOPPED, Status.KILLED, Status.SUCCESS, Status.NONE):
|
||||||
|
# Nothing to do, the computation is already stopped.
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
logging.debug(f"Cannot stop process: node is not running (status is: {self._status.status}).")
|
||||||
|
return
|
||||||
|
|
||||||
self.node.nodeDesc.stopProcess(self)
|
self.node.nodeDesc.stopProcess(self)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue