--- android/TrainInfoService/src/dk/thoerup/traininfoservice/StatisticsListener.java 2010/08/30 15:49:20 1022 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/StatisticsListener.java 2010/08/30 15:53:09 1023 @@ -21,14 +21,18 @@ update_interval = getUpdateInterval( sce.getServletContext() ); - log.info("StatisticsListener::contextInit called update_interval=" + update_interval); + if (! sce.getServletContext().getRealPath("/").startsWith("/home/app/") ) { //if path not starts with /home/app then it is not running on a production server and we only collects stats on prod servers + log.info("This is not a prod. server, dont start Statistics saver"); return; } + + if ( update_interval > 0 ) { + log.info("Statistics saver started with update_interval=" + update_interval); timer = new Timer(); TimerTask statsUpdate = new TimerTask() { @@ -39,6 +43,8 @@ }; timer.schedule(statsUpdate, 0, update_interval); + } else { + log.info("Statistics saver disabled (update_interval == 0) "); } }