Skip to content

Commit

Permalink
remove un-necessary thread-local op based on discussion in #1410
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrthomas committed Dec 25, 2020
1 parent cd67555 commit 5fe026f
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ public synchronized Response handle(Request req) { // note the [synchronized]
LOCAL_REQUEST.set(req);
req.processBody();
ScenarioEngine engine = new ScenarioEngine(runtime, new HashMap(globals));
// highly unlikely but support mocks calling other mocks in the same jvm
ScenarioEngine prevEngine = ScenarioEngine.get();
ScenarioEngine.set(engine);
engine.init();
engine.setVariable(ScenarioEngine.REQUEST_URL_BASE, req.getUrlBase());
Expand Down Expand Up @@ -177,7 +175,6 @@ public synchronized Response handle(Request req) { // note the [synchronized]
responseHeaders = engine.vars.remove(ScenarioEngine.RESPONSE_HEADERS);
responseDelay = engine.vars.remove(RESPONSE_DELAY);
globals.putAll(engine.detachVariables());
ScenarioEngine.set(prevEngine);
Response res = new Response(200);
if (result.isFailed()) {
response = new Variable(result.getError().getMessage());
Expand Down Expand Up @@ -209,7 +206,6 @@ public synchronized Response handle(Request req) { // note the [synchronized]
return res;
}
}
ScenarioEngine.set(prevEngine);
runtime.logger.warn("no scenarios matched, returning 404: {}", req);
return new Response(404);
}
Expand Down

0 comments on commit 5fe026f

Please sign in to comment.