Fix RAM usage on multiple usages

This commit is contained in:
2025-04-18 14:52:27 +02:00
parent 925901e40e
commit 83c20729fa
+4 -1
View File
@@ -82,11 +82,15 @@ class DevServer extends DefaultTask {
@Internal @Internal
String host String host
@Internal
Boolean running = true
class Finalizer extends DefaultTask { class Finalizer extends DefaultTask {
Finalizer() { Finalizer() {
super() super()
doLast { doLast {
running = false
if (processInput != null) { if (processInput != null) {
processInput.write(template.endsWith("Velocity") ? "end\n" : "stop\n") processInput.write(template.endsWith("Velocity") ? "end\n" : "stop\n")
processInput.flush() processInput.flush()
@@ -137,7 +141,6 @@ class DevServer extends DefaultTask {
devPy.append(" $template") devPy.append(" $template")
def process = new ProcessBuilder("ssh", host, "-T", devPy.toString()).start() def process = new ProcessBuilder("ssh", host, "-T", devPy.toString()).start()
def running = true;
def processOutput = new BufferedReader(new InputStreamReader(process.inputStream)) def processOutput = new BufferedReader(new InputStreamReader(process.inputStream))
new Thread({ new Thread({
while (running) { while (running) {