forked from SteamWar/SteamWar
Fix RAM usage on multiple usages
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user