v++
Лимит ошибок связи 10
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
}
|
||||
//--
|
||||
|
||||
Reference in New Issue
Block a user