Mercurial > hg > digilib-old
changeset 926:2c70e595e4d7
better timeout log message
author | robcast |
---|---|
date | Mon, 19 Dec 2011 21:55:49 +0100 |
parents | 66f1ba72d07b |
children | 95d8184995ab |
files | servlet3/src/main/java/digilib/servlet/AsyncServletWorker.java |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/servlet3/src/main/java/digilib/servlet/AsyncServletWorker.java Mon Dec 19 21:39:17 2011 +0100 +++ b/servlet3/src/main/java/digilib/servlet/AsyncServletWorker.java Mon Dec 19 21:55:49 2011 +0100 @@ -36,7 +36,7 @@ private long startTime; private ErrMsg errMsgType = ErrMsg.IMAGE; private ImageJobDescription jobinfo; - /** flag to indicate that the response is completed (on abort)*/ + /** flag to indicate that the response is completed (on abort) */ private boolean completed = false; /** AsyncRequest timeout */ protected static long timeout = 60000l; @@ -133,23 +133,27 @@ } imageWorker.stopNow(); this.completed = true; - Scaler.digilibError(errMsgType, Error.UNKNOWN, null, (HttpServletResponse) asyncContext.getResponse()); + Scaler.digilibError(errMsgType, Error.UNKNOWN, null, + (HttpServletResponse) asyncContext.getResponse()); asyncContext.complete(); } @Override public void onTimeout(AsyncEvent event) throws IOException { - logger.error("AsyncServletWorker TIMED OUT! (increase worker-timeout?)"+event); + logger.error("AsyncServletWorker TIMED OUT after " + + (System.currentTimeMillis() - startTime) + + "ms! (increase worker-timeout?)"); if (completed) { logger.debug("AsyncServletWorker already completed (TimeOut)!"); return; } imageWorker.stopNow(); this.completed = true; - Scaler.digilibError(errMsgType, Error.UNKNOWN, null, (HttpServletResponse) asyncContext.getResponse()); + Scaler.digilibError(errMsgType, Error.UNKNOWN, null, + (HttpServletResponse) asyncContext.getResponse()); asyncContext.complete(); } - + public static long getTimeout() { return timeout; }