You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//If the PID is alive, assume the join link we have is still
397
+
// valid. The join link seems to change even if it is the same
398
+
// backend running, so if we always fetched the link the client
399
+
//would relaunch over and over.
397
400
return currentStatus
398
401
}
399
-
// Get new PID and join link.
402
+
403
+
// See if there is already a backend running. Weirdly, there is
404
+
// always a PID, even if there is no backend running, and
405
+
// backendUnresponsive is always false, but the links are null so
406
+
// hopefully that is an accurate indicator that the IDE is up.
400
407
val status = accessor.getHostIdeStatus(ideDir, remoteProjectPath)
401
-
logger.info("Got ${workspace.ideName} status from ${workspace.hostname}:${ideDir.toRawString()}, pid=${status.appPid} project=${remoteProjectPath.toRawString()} joinLink=${status.joinLink}")
402
-
status
408
+
if (!status.joinLink.isNullOrBlank()) {
409
+
logger.info("Found existing ${workspace.ideName} backend on $details")
410
+
return status
411
+
}
412
+
413
+
// Otherwise, spawn a new backend. This does not seem to spawn a
414
+
// second backend if one is already running, yet it does somehow
415
+
// cause a second client to launch. So only run this if we are
416
+
// really sure we have to launch a new backend.
417
+
logger.info("Starting ${workspace.ideName} backend on $details")
logger.info("Failed to get ${workspace.ideName} status from ${workspace.hostname}:${ideDir.toRawString()}, project=${remoteProjectPath.toRawString()}", ex)
422
+
logger.info("Failed to get ${workspace.ideName} status from $details", ex)
0 commit comments