mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 02:08:08 +02:00
[core] stats: avoid crash in psutil (windows only)
https://github.com/giampaolo/psutil/issues/1763
This commit is contained in:
parent
7dc44a3441
commit
88099dd28c
1 changed files with 13 additions and 9 deletions
|
@ -201,15 +201,19 @@ class ProcStatistics:
|
|||
data = proc.as_dict(self.dynamicKeys)
|
||||
for k, v in data.items():
|
||||
self._addKV(k, v)
|
||||
|
||||
files = [f.path for f in proc.open_files()]
|
||||
if self.lastIterIndexWithFiles != -1:
|
||||
if set(files) != set(self.openFiles[self.lastIterIndexWithFiles]):
|
||||
self.openFiles[self.iterIndex] = files
|
||||
self.lastIterIndexWithFiles = self.iterIndex
|
||||
elif files:
|
||||
self.openFiles[self.iterIndex] = files
|
||||
self.lastIterIndexWithFiles = self.iterIndex
|
||||
|
||||
## Note: Do not collect stats about open files for now,
|
||||
# as there is bug in psutil-5.7.2 on Windows which crashes the application.
|
||||
# https://github.com/giampaolo/psutil/issues/1763
|
||||
#
|
||||
# files = [f.path for f in proc.open_files()]
|
||||
# if self.lastIterIndexWithFiles != -1:
|
||||
# if set(files) != set(self.openFiles[self.lastIterIndexWithFiles]):
|
||||
# self.openFiles[self.iterIndex] = files
|
||||
# self.lastIterIndexWithFiles = self.iterIndex
|
||||
# elif files:
|
||||
# self.openFiles[self.iterIndex] = files
|
||||
# self.lastIterIndexWithFiles = self.iterIndex
|
||||
self.iterIndex += 1
|
||||
|
||||
def toDict(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue