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
Copy file name to clipboardExpand all lines: serverhost-runtime/src/main/kotlin/app/simplecloud/droplet/serverhost/runtime/config/environment/EnvironmentConfig.kt
Copy file name to clipboardExpand all lines: serverhost-runtime/src/main/kotlin/app/simplecloud/droplet/serverhost/runtime/runner/ServerRunner.kt
+26-11Lines changed: 26 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -79,9 +79,14 @@ class ServerRunner(
79
79
80
80
// Retrieving this before the ping makes it possible to stop servers way sooner (port is registered in system nearly instantly, it takes longer for the
81
81
// server to respond to pings though)
82
-
val executable = environmentsRepository.get(runtimeRepository.get(server.group))?.getExecutable()
82
+
val executable = environmentsRepository.get(runtimeRepository.get(server.group))
83
83
val handle =PortProcessHandle.of(server.port.toInt()).orElse(null)?.let {
84
-
val realProcess =ProcessFinder.findHighestProcessParent(getServerDir(server).toPath(), it).orElse(null)
84
+
val realProcess = executable?.getRealExecutable()?.let { exe ->
85
+
ProcessFinder.findHighestProcessWorkingDir(
86
+
getServerDir(server).toPath(), it,
87
+
exe
88
+
).orElse(null)
89
+
}
85
90
if (realProcess !=null&& serverToProcessHandle[server] != realProcess) {
86
91
logger.info("Found updated process handle with PID ${realProcess.pid()} for ${server.group}-${server.numericalId}")
0 commit comments