wait for client manager to load before connecting

pull/34/head
Zlatin Balevsky 2019-11-30 17:32:02 +00:00
parent d0b62af32e
commit ad8983e889
1 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,16 @@ public class MuWireServlet extends HttpServlet {
super.init(config);
RouterContext ctx = (RouterContext) I2PAppContext.getGlobalContext();
while(!ctx.clientManager().isAlive()) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new ServletException(e);
}
}
String home = ctx.getConfigDir()+File.separator+"plugins"+File.separator+"MuWire";
String version = config.getInitParameter("version");