From 4167cd955b276cce2fb7708444bec56cb004e063 Mon Sep 17 00:00:00 2001 From: zzz Date: Sun, 18 May 2014 23:24:03 +0000 Subject: [PATCH] Console: Cheap workaround for old wrappers (ticket #1285) --- .../i2p/router/web/ConfigServiceHandler.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java index a5fd58fb8..b9d3beffb 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigServiceHandler.java @@ -72,15 +72,19 @@ public class ConfigServiceHandler extends FormHandler { ContextHelper.getContext(null).router().killKeys(); if (_tellWrapper) { int wait = WAIT; - Properties props = WrapperManager.getProperties(); - String tmout = props.getProperty("wrapper.jvm_exit.timeout"); - if (tmout != null) { - try { - int cwait = Integer.parseInt(tmout) * 1000; - if (cwait > wait) - wait = cwait; - } catch (NumberFormatException nfe) {} - } + // getProperties() not available on old wrappers, + // TODO find out what version and test + try { + Properties props = WrapperManager.getProperties(); + String tmout = props.getProperty("wrapper.jvm_exit.timeout"); + if (tmout != null) { + try { + int cwait = Integer.parseInt(tmout) * 1000; + if (cwait > wait) + wait = cwait; + } catch (NumberFormatException nfe) {} + } + } catch (Throwable t) {} WrapperManager.signalStopping(wait); } } catch (Throwable t) {