Skip to content

Commit 1873817

Browse files
committed
adjustments for windows
1 parent 31333a7 commit 1873817

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ldm/invoke/config/invokeai_update.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ def get_versions()->dict:
3333

3434
def invokeai_is_running()->bool:
3535
for p in psutil.process_iter():
36-
cmdline = p.cmdline()
37-
matches = [x for x in cmdline if x.endswith('invokeai')]
38-
if matches:
39-
print(f':exclamation: [bold red]An InvokeAI instance appears to be running as process {p.pid}[/red bold]')
40-
return True
36+
try:
37+
cmdline = p.cmdline()
38+
matches = [x for x in cmdline if x.endswith(('invokeai','invokeai.exe'))]
39+
if matches:
40+
print(f':exclamation: [bold red]An InvokeAI instance appears to be running as process {p.pid}[/red bold]')
41+
return True
42+
except psutil.AccessDenied:
43+
continue
4144
return False
4245

4346

0 commit comments

Comments
 (0)