v++
рефакторинг. Исправлен баг. если прервать локальную задачу, не удалялся файл interrupt.
This commit is contained in:
@@ -3,9 +3,9 @@ import GlobalData.Machine.Machine;
|
||||
import GlobalData.User.User;
|
||||
import TestingSystem.DVM.UserConnection;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class ConnectionPass_2023<T> extends Pass_2021<T> {
|
||||
public class ConnectionPass<T> extends Pass_2021<T> {
|
||||
protected Machine machine = null;
|
||||
protected User user = null;
|
||||
public User user = null;
|
||||
//--
|
||||
protected void Connect() throws Exception{
|
||||
user.connection = null;
|
||||
@@ -1,6 +1,5 @@
|
||||
package Visual_DVM_2021.Passes.SSH;
|
||||
import Common.Current;
|
||||
import files.ConnectionPass;
|
||||
//завязан на текущие машину и юзера
|
||||
public abstract class CurrentConnectionPass<T> extends ConnectionPass<T> {
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package Visual_DVM_2021.Passes.SSH;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import GlobalData.Tasks.Supervisor.Remote.RemoteTaskSupervisor;
|
||||
import files.ConnectionPass;
|
||||
public abstract class TaskConnectionPass<S extends RemoteTaskSupervisor> extends ConnectionPass {
|
||||
public S supervisor; //инициализация идет в конструкторе потомка.
|
||||
public TaskConnectionPass(Class<S> s_class) {
|
||||
@@ -21,6 +22,14 @@ public abstract class TaskConnectionPass<S extends RemoteTaskSupervisor> extends
|
||||
machine = supervisor.task.getMachine();
|
||||
user = supervisor.task.getUser();
|
||||
super.Connect();
|
||||
RemoteFile userWorkspace = new RemoteFile(user.workspace, true);
|
||||
if (!user.connection.Exists(userWorkspace))
|
||||
throw new WorkspaceNotFoundException(
|
||||
"Рабочее пространство пользователя " + Utils.Brackets(user.login)
|
||||
+ " на машине " + Utils.Brackets(machine.getURL())
|
||||
+ "\n" + Utils.Brackets(user.workspace) + "\nне найдено.\n" +
|
||||
"Требуется выполнить повторную инициализацию пользователя."
|
||||
);
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user