Skip to content

Commit

Permalink
[core] Only update the running chunk to STOPPED when stopping compu…
Browse files Browse the repository at this point in the history
…tations

Chunks of that node that are already in the `SUCCESS` state will not be
updated, and those that are `SUBMITTED` but not `RUNNING` will be reset
to `NONE`.
  • Loading branch information
cbentejac committed Nov 24, 2023
1 parent bb9195f commit f51bf18
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ def process(self, forceCompute=False):
self.upgradeStatusTo(Status.SUCCESS)

def stopProcess(self):
self.upgradeStatusTo(Status.STOPPED)
if not self.isExtern():
if self._status.status == Status.RUNNING:
self.upgradeStatusTo(Status.STOPPED)
elif self._status.status == Status.SUBMITTED:
self.upgradeStatusTo(Status.NONE)
self.node.nodeDesc.stopProcess(self)

def isExtern(self):
Expand Down Expand Up @@ -942,8 +946,7 @@ def endSequence(self):
def stopComputation(self):
""" Stop the computation of this node. """
for chunk in self._chunks.values():
if not chunk.isExtern():
chunk.stopProcess()
chunk.stopProcess()

def getGlobalStatus(self):
"""
Expand Down

0 comments on commit f51bf18

Please sign in to comment.