mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-12 15:27:14 +03:00
[610] Improved process_iter
Significant speed-up. Around 20x in psutils 6.0!
This commit is contained in:
parent
759fc12dcb
commit
1e9dec1371
@ -2156,12 +2156,11 @@ class EDLogs(FileSystemEventHandler):
|
||||
# Process likely expired
|
||||
self.running_process = None
|
||||
if not self.running_process:
|
||||
edmc_process = psutil.Process()
|
||||
edmc_user = edmc_process.username()
|
||||
try:
|
||||
for pid in psutil.pids():
|
||||
proc = psutil.Process(pid)
|
||||
if 'EliteDangerous' in proc.name() and proc.username() == edmc_user:
|
||||
edmc_process = psutil.Process()
|
||||
edmc_user = edmc_process.username()
|
||||
for proc in psutil.process_iter(['name', 'username']):
|
||||
if 'EliteDangerous' in proc.info['name'] and proc.info['username'] == edmc_user:
|
||||
self.running_process = proc
|
||||
return True
|
||||
except psutil.NoSuchProcess:
|
||||
|
@ -5,4 +5,4 @@ simplesystray==0.1.0; sys_platform == 'win32'
|
||||
semantic-version==2.10.0
|
||||
# For manipulating folder permissions and the like.
|
||||
pywin32==306; sys_platform == 'win32'
|
||||
psutil==5.9.8
|
||||
psutil==6.0.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user