refactor
This commit is contained in:
coderfengyun 2014-09-01 09:09:30 +08:00
parent 2b77bb473b
commit 4c05dd7415
1 changed files with 3 additions and 3 deletions

View File

@ -265,13 +265,11 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements
if (allocationFinish(load)) {
break;
}
if (this.queryAgentStatus(agent) == null || agent.isInUse()
|| agent.getRemainLoad() != agent.getMaxLoad()) {
if (agent.isInUse()) {
continue;
}
loadForRunCurrent = getMin(load, agent.getRemainLoad());
agent.bookTest(loadForRunCurrent);
this.getAgentRepository().update(agent);
runScenarioResultModel = this.getAgentMessenger().bookTest(agent,
loadForRunCurrent);
if (runScenarioResultModel == null
@ -279,6 +277,7 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements
logger.error(runScenarioResultModel == null ? "runScenarioResultModel is null"
: "runScenarioResultModel.getRunId()"
+ runScenarioResultModel.getRunId());
agent.backLoad(loadForRunCurrent);
continue;
}
load -= loadForRunCurrent;
@ -289,6 +288,7 @@ public class HighAvailablePoolImpl extends CurrentLoadSubject implements
runScenarioResultModel.getRunId());
result.add(runningAgentWithouRunningScript);
this.addABlotter(runningAgentWithouRunningScript);
this.getAgentRepository().update(agent);
}
if (!allocationFinish(load)) {
logger.error("allocationUnfinished, remain " + load