added error field, removed buggy thread exit after 1000 requests
This commit is contained in:
parent
7c0b2cc9d9
commit
5af80ba48b
1 changed files with 2 additions and 8 deletions
|
@ -166,6 +166,7 @@ public class RequestEvaluator implements Runnable {
|
||||||
global.putHiddenProperty("user", esu);
|
global.putHiddenProperty("user", esu);
|
||||||
global.putHiddenProperty ("req", new ESWrapper (req, evaluator));
|
global.putHiddenProperty ("req", new ESWrapper (req, evaluator));
|
||||||
global.putHiddenProperty ("res", new ESWrapper (res, evaluator));
|
global.putHiddenProperty ("res", new ESWrapper (res, evaluator));
|
||||||
|
if (error != null) res.error = error;
|
||||||
global.putHiddenProperty ("path", reqPath);
|
global.putHiddenProperty ("path", reqPath);
|
||||||
global.putHiddenProperty ("app", appnode);
|
global.putHiddenProperty ("app", appnode);
|
||||||
// set and mount the request data object
|
// set and mount the request data object
|
||||||
|
@ -287,7 +288,6 @@ public class RequestEvaluator implements Runnable {
|
||||||
localrtx.timer.beginEvent (requestPath+" execute");
|
localrtx.timer.beginEvent (requestPath+" execute");
|
||||||
current.doIndirectCall (evaluator, current, action.getFunctionName (), new ESValue[0]);
|
current.doIndirectCall (evaluator, current, action.getFunctionName (), new ESValue[0]);
|
||||||
localrtx.timer.endEvent (requestPath+" execute");
|
localrtx.timer.endEvent (requestPath+" execute");
|
||||||
done = true;
|
|
||||||
} catch (RedirectException redirect) {
|
} catch (RedirectException redirect) {
|
||||||
res.redirect = redirect.getMessage ();
|
res.redirect = redirect.getMessage ();
|
||||||
done = true;
|
done = true;
|
||||||
|
@ -458,14 +458,8 @@ public class RequestEvaluator implements Runnable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new Thread every 1000 requests. The current one will fade out
|
|
||||||
if (txcount++ > 1000) {
|
|
||||||
// stop thread - a new one will be created when needed
|
|
||||||
localrtx.closeConnections ();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure there is only one thread running per instance of this class
|
// make sure there is only one thread running per instance of this class
|
||||||
|
// if localrtx != rtx, the current thread has been aborted and there's no need to notify
|
||||||
if (localrtx != rtx) {
|
if (localrtx != rtx) {
|
||||||
localrtx.closeConnections ();
|
localrtx.closeConnections ();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue