Лимит ошибок связи 10
This commit is contained in:
2024-04-08 01:30:46 +03:00
parent 09afe82704
commit 4e503d3b9b
8 changed files with 56 additions and 24 deletions

View File

@@ -138,28 +138,40 @@ public abstract class TestingPlanner<P extends TestingPackage> {
//--
Print(testingPackage.id + ":" + testingPackage.state.getDescription());
//--
InitSessionCredentials();
if (testingPackage.state.equals(TasksPackageState.Analysis)) {
AnalyseResults();
UpdatePackageState(TasksPackageState.Done);
} else {
try {
if (Connect()) {
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
if (ptk_id != Constants.Nan) {
Print("package " + testingPackage.id + " NEEDS TO KILL");
Kill();
UpdatePackageState(TasksPackageState.Aborted);
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
if (testingPackage.connectionErrosCount>=10){
Print(testingPackage.id+" had 10 connection errors. stop");
UpdatePackageState(TasksPackageState.ConnectionError);
}else {
//--
InitSessionCredentials();
if (testingPackage.state.equals(TasksPackageState.Analysis)) {
AnalyseResults();
UpdatePackageState(TasksPackageState.Done);
} else {
try {
if (Connect()) {
int ptk_id = (int) ServerCommand(getCheckIfNeedsKillCode(), testingPackage.id);
if (ptk_id != Constants.Nan) {
Print("package " + testingPackage.id + " NEEDS TO KILL");
Kill();
UpdatePackageState(TasksPackageState.Aborted);
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(TestingPackageToKill.class, ptk_id));
} else {
Session();
}
} else {
Session();
testingPackage.connectionErrosCount++;
UpdatePackage();
}
} catch (Exception ex) {
Print("Ошибка сеанса. Соединение будет разорвано.");
Print(ex.getMessage());
Disconnect();
//
testingPackage.connectionErrosCount++;
UpdatePackage();
} finally {
}
} catch (Exception ex) {
Print("Ошибка сеанса. Соединение будет разорвано.");
Print(ex.getMessage());
Disconnect();
} finally {
}
}
//--