Оптимизация команды Exists для SSH

This commit is contained in:
2023-12-04 14:42:36 +03:00
parent 1f8ebdc9a2
commit 163552d74f
13 changed files with 93 additions and 100 deletions

View File

@@ -42,15 +42,17 @@ public abstract class RemoteTaskSupervisor<T extends Task> extends TaskSuperviso
}
@Override
protected void CheckTask() throws Exception {
if (pass.Exists(getRemoteProject().full_name, Constants.DONE))
RemoteFile DONE = new RemoteFile(getRemoteProject(), Constants.DONE);
RemoteFile TIMEOUT = new RemoteFile(getRemoteProject(), Constants.TIMEOUT);
if (pass.Exists(DONE))
task.state = TaskState.Finished;
else if (pass.Exists(getRemoteProject().full_name, Constants.TIMEOUT))
else if (pass.Exists(TIMEOUT))
task.state = TaskState.AbortedByTimeout;
}
@Override
protected void AchieveResults() throws Exception {
pass.tryGetSingleFile(getRemoteOutput(), task.getOutputFile(), 10240);
pass.tryGetSingleFile(getRemoteErrors(), task.getErrorsFile(), 10240);
pass.tryGetSingleFileWithMaxSize(getRemoteOutput(), task.getOutputFile(), 10240);
pass.tryGetSingleFileWithMaxSize(getRemoteErrors(), task.getErrorsFile(), 10240);
}
@Override
protected void AbortTask() throws Exception {
@@ -58,7 +60,7 @@ public abstract class RemoteTaskSupervisor<T extends Task> extends TaskSuperviso
}
@Override
protected void CalculatePerformanceTime() throws Exception {
if (pass.tryGetSingleFile(getRemoteTime(), task.getTimeFile(), 0))
if (pass.tryGetSingleFileWithMaxSize(getRemoteTime(), task.getTimeFile(), 0))
task.RefreshTime();
}
protected String getStartCommand() {