Add cancel
This commit is contained in:
@@ -115,7 +115,7 @@ namespace LeafWeb.Core.Remote
|
||||
Disconnect(leafInput, ssh);
|
||||
|
||||
if (command.ExitStatus != 0)
|
||||
throw new PiscalClientException(leafInput.LeafInputId, command.Error.TrimEndNewLine());
|
||||
throw new PiscalClientException(leafInput.LeafInputId, command);
|
||||
|
||||
var result = command.Result.TrimEndNewLine();
|
||||
if (result == "started")
|
||||
@@ -154,7 +154,7 @@ namespace LeafWeb.Core.Remote
|
||||
Disconnect(leafInput, ssh);
|
||||
|
||||
if (command.ExitStatus != 0)
|
||||
throw new PiscalClientException(leafInput.LeafInputId, command.Error.TrimEndNewLine());
|
||||
throw new PiscalClientException(leafInput.LeafInputId, command);
|
||||
|
||||
return command.Result
|
||||
.SplitNewLine()
|
||||
@@ -203,7 +203,22 @@ namespace LeafWeb.Core.Remote
|
||||
Disconnect(leafInput, scp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void KillLeafProcess(PiscalLeafInput leafInput)
|
||||
{
|
||||
using (var ssh = GetSshClient())
|
||||
{
|
||||
Connect(leafInput, ssh);
|
||||
var commandText = $"{RemoteScriptPath} -d {leafInput.PiscalDirectoryName} -k";
|
||||
var command = ssh.CreateCommand(commandText);
|
||||
command.Execute();
|
||||
Disconnect(leafInput, ssh);
|
||||
|
||||
if (command.ExitStatus != 0)
|
||||
throw new PiscalClientException(leafInput.LeafInputId, command);
|
||||
}
|
||||
}
|
||||
|
||||
public void CleanupLeafProcess(PiscalLeafInput leafInput)
|
||||
{
|
||||
using (var ssh = GetSshClient())
|
||||
@@ -215,7 +230,7 @@ namespace LeafWeb.Core.Remote
|
||||
Disconnect(leafInput, ssh);
|
||||
|
||||
if (command.ExitStatus != 0)
|
||||
throw new PiscalClientException(leafInput.LeafInputId, command.Error.TrimEndNewLine());
|
||||
throw new PiscalClientException(leafInput.LeafInputId, command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user