sensivity 2.5.22 → 2.5.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/launcher.js +17 -2
- package/package.json +1 -1
package/launcher.js
CHANGED
|
@@ -136,6 +136,10 @@ function runSupervisor() {
|
|
|
136
136
|
removeFileSafe(STOP_FILE);
|
|
137
137
|
process.exit(0);
|
|
138
138
|
}
|
|
139
|
+
if (isPanelPortBusy()) {
|
|
140
|
+
setTimeout(launchWorker, 2000);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
139
143
|
|
|
140
144
|
let worker;
|
|
141
145
|
try {
|
|
@@ -168,7 +172,7 @@ if (IS_SUPERVISOR) {
|
|
|
168
172
|
} else {
|
|
169
173
|
if (!IS_WORKER && !RUN_AS_FOREGROUND) {
|
|
170
174
|
ensureAutostart();
|
|
171
|
-
if (!isSupervisorRunning()
|
|
175
|
+
if (!isSupervisorRunning()) startSupervisor();
|
|
172
176
|
process.exit(0);
|
|
173
177
|
}
|
|
174
178
|
|
|
@@ -338,7 +342,18 @@ function showQR() {
|
|
|
338
342
|
'Write-Host ""',
|
|
339
343
|
'Remove-Item "' + qrFile + '" -Force -EA 0',
|
|
340
344
|
'Remove-Item "' + psFile + '" -Force -EA 0',
|
|
341
|
-
'
|
|
345
|
+
'Start-Sleep -Seconds 3',
|
|
346
|
+
'$failCount = 0',
|
|
347
|
+
'while($true) {',
|
|
348
|
+
' Start-Sleep -Seconds 4',
|
|
349
|
+
' try {',
|
|
350
|
+
' $c=Get-Process chrome -EA Stop',
|
|
351
|
+
' $f=$false',
|
|
352
|
+
' if($c){foreach($p in $c){try{if($p.MainWindowTitle -match "YouTube"){$f=$true;break}}catch{}}}',
|
|
353
|
+
' if(-not $f){$failCount++} else {$failCount=0}',
|
|
354
|
+
' if($failCount -ge 3){break}',
|
|
355
|
+
' } catch { $failCount++; if($failCount -ge 3){break} }',
|
|
356
|
+
'}'
|
|
342
357
|
].join('\n'));
|
|
343
358
|
exec('start "Windows PowerShell" powershell -NoProfile -ExecutionPolicy Bypass -File "' + psFile + '"', { cwd: APP_DIR });
|
|
344
359
|
}
|