mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-10 07:36:52 +02:00
[ui] Nodes status monitoring simplification
* store status file last modification time on NodeChunk * ChunksMonitor: don't stop the underlying thread when changing chunks, only modify the list of monitored files + use a mutex for thread-safety
This commit is contained in:
parent
6b7065dd5d
commit
f6a42cb86e
2 changed files with 35 additions and 51 deletions
|
@ -144,6 +144,7 @@ class NodeChunk(BaseObject):
|
|||
self.range = range
|
||||
self.status = StatusData(node.name, node.nodeType, node.packageName, node.packageVersion)
|
||||
self.statistics = stats.Statistics()
|
||||
self.statusFileLastModTime = -1
|
||||
self._subprocess = None
|
||||
# notify update in filepaths when node's internal folder changes
|
||||
self.node.internalFolderChanged.connect(self.nodeFolderChanged)
|
||||
|
@ -175,11 +176,13 @@ class NodeChunk(BaseObject):
|
|||
oldStatus = self.status.status
|
||||
# No status file => reset status to Status.None
|
||||
if not os.path.exists(statusFile):
|
||||
self.statusFileLastModTime = -1
|
||||
self.status.reset()
|
||||
else:
|
||||
with open(statusFile, 'r') as jsonFile:
|
||||
statusData = json.load(jsonFile)
|
||||
self.status.fromDict(statusData)
|
||||
self.statusFileLastModTime = os.path.getmtime(statusFile)
|
||||
if oldStatus != self.status.status:
|
||||
self.statusChanged.emit()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue