Исправление зависания кнопки запуска сервера
This commit is contained in:
2024-04-09 19:46:15 +03:00
parent 3d70efe253
commit e4fe527365
11 changed files with 29 additions and 43 deletions

View File

@@ -2,6 +2,7 @@ package Visual_DVM_2021.Passes.SSH;
import Common.Constants;
import Common.Current;
import Common.Global;
import Common.UI.UI;
import Common.Utils.Utils;
import GlobalData.Machine.Machine;
import GlobalData.Machine.MachineType;
@@ -40,14 +41,17 @@ public abstract class RepositoryServerSSHPass extends ConnectionPass {
}
//--
protected void StartServer() throws Exception {
user.connection.performScript(serverHome, "nohup java -jar " + getServerFileName()+
" &");
user.connection.startShellProcess(serverHome,Constants.STARTED, "java -jar " + getServerFileName());
//--
RemoteFile STARTED = new RemoteFile(serverHome, Constants.STARTED);
RemoteFile StartLog = new RemoteFile(serverHome, Constants.STARTED +
"_by_" +
Current.getAccount().email +
"_" +
new Date().toString()
);
user.connection.sftpChannel.rename(STARTED.full_name, StartLog.full_name);
user.connection.writeToFile("+", StartLog);
//--
RemoteFile[] files = new RemoteFile[]{
@@ -62,6 +66,7 @@ public abstract class RepositoryServerSSHPass extends ConnectionPass {
}
protected void ShutdownServer() throws Exception {
//--
// UI.Info("+");
RemoteFile INTERRUPT = new RemoteFile(serverHome, Constants.INTERRUPT);
RemoteFile ABORTED = new RemoteFile(serverHome, Constants.ABORTED);
//--