19 |
|
|
20 |
public void contextInitialized(ServletContextEvent sce) { |
public void contextInitialized(ServletContextEvent sce) { |
21 |
|
|
22 |
update_interval = getUpdateInterval( sce.getServletContext() ); |
TraininfoSettings settings = SettingsListener.loadSettings(sce.getServletContext()); |
|
|
|
23 |
|
|
24 |
|
update_interval = settings.getStatsInterval(); |
25 |
|
|
26 |
if (! sce.getServletContext().getRealPath("/").startsWith("/home/app/") ) { |
if (! sce.getServletContext().getRealPath("/").startsWith("/home/app/") ) { |
27 |
//if path not starts with /home/app then it is not running on a production server and we only collects stats on prod servers |
//if path not starts with /home/app then it is not running on a production server and we only collects stats on prod servers |
57 |
} |
} |
58 |
} |
} |
59 |
|
|
|
private int getUpdateInterval(ServletContext cntx) { |
|
|
int interval = 0; |
|
|
try { |
|
|
String intervalStr = cntx.getInitParameter("stats_interval"); |
|
|
interval = Integer.parseInt(intervalStr); |
|
|
} catch (Exception e) {} |
|
|
|
|
|
return interval; |
|
|
} |
|
60 |
} |
} |