Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ProcessHandle.of(pid) in ParentProcessWatcher #400

Open
fbricon opened this issue May 25, 2023 · 0 comments
Open

Use ProcessHandle.of(pid) in ParentProcessWatcher #400

fbricon opened this issue May 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@fbricon
Copy link
Contributor

fbricon commented May 25, 2023

Code from

// Wait until parent process id is available
final long pid = server.getParentProcessId();
if (pid == 0 || lastActivityTime > (System.currentTimeMillis() - INACTIVITY_DELAY_SECS)) {
return true;
}
String command;
if (isWindows) {
command = "cmd /c \"tasklist /FI \"PID eq " + pid + "\" | findstr " + pid + "\"";
} else {
command = "kill -0 " + pid;
}

could be updated to use ProcessHandle.of(pid), similar to eclipse-jdtls/eclipse.jdt.ls@c2f4710

@fbricon fbricon added the enhancement New feature or request label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant