mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-82160: No need to kill process explicitly as it is not part of Eel API.
See previous commit. GitOrigin-RevId: 155c6a407da75e6f0be8afce70c167adfb03bcb9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9cf4ff7e6e
commit
d707df8c14
+5
-16
@@ -38,20 +38,7 @@ internal object ExecServiceImpl : ExecService {
|
||||
val binary = if (binary.isAbsolute) binary else options.workingDirectory?.resolve(binary) ?: binary.toAbsolutePath()
|
||||
val eelPath = binary.asEelPath()
|
||||
val executableProcess = EelExecutableProcess(eelPath, args, options.env, options.workingDirectory, description)
|
||||
val eelProcess = executableProcess.run().getOr { return@coroutineScope it }
|
||||
launch(start = CoroutineStart.UNDISPATCHED) {
|
||||
try {
|
||||
eelProcess.exitCode.await()
|
||||
}
|
||||
catch (e: CancellationException) {
|
||||
withContext(NonCancellable) {
|
||||
eelProcess.kill()
|
||||
eelProcess.exitCode.await()
|
||||
}
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
val eelProcess = executableProcess.run(this).getOr { return@coroutineScope it }
|
||||
val result = try {
|
||||
withTimeout(options.timeout) {
|
||||
val interactiveResult = processInteractiveHandler.getResultFromProcess(binary, args, eelProcess)
|
||||
@@ -81,13 +68,15 @@ private data class EelExecutableProcess(
|
||||
)
|
||||
|
||||
@CheckReturnValue
|
||||
private suspend fun EelExecutableProcess.run(): PyExecResult<EelProcess> {
|
||||
private suspend fun EelExecutableProcess.run(scopeToBound: CoroutineScope): PyExecResult<EelProcess> {
|
||||
val workingDirectory = if (workingDirectory != null && !workingDirectory.isAbsolute) workingDirectory.toRealPath() else workingDirectory
|
||||
try {
|
||||
val executionResult = exe.descriptor.toEelApi().exec.spawnProcess(exe.toString())
|
||||
.scope(scopeToBound)
|
||||
.args(args)
|
||||
.env(env)
|
||||
.workingDirectory(workingDirectory?.asEelPath()).eelIt()
|
||||
.workingDirectory(workingDirectory?.asEelPath())
|
||||
.eelIt()
|
||||
|
||||
return Result.success(executionResult)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user