mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
adding message to UI to make port change transparent
This commit is contained in:
parent
52228cb6be
commit
cef5fde343
|
@ -13,7 +13,7 @@
|
|||
-->
|
||||
</script>
|
||||
<!-- redirecting browser if port was changed -->
|
||||
#(reconnect)#::<meta http-equiv="refresh" content="10; url=http://#[host]#:#[port]#/ConfigBasic.html" />#(/reconnect)#
|
||||
#(reconnect)#::<meta http-equiv="refresh" content="5; url=http://#[host]#:#[port]#/ConfigBasic.html" />#(/reconnect)#
|
||||
<!-- redirecting browser if language was changed -->
|
||||
#(changedLanguage)#::<meta http-equiv="refresh" content="0; url=ConfigBasic.html" />#(/changedLanguage)#
|
||||
</head>
|
||||
|
@ -118,6 +118,8 @@
|
|||
</fieldset>
|
||||
</li>
|
||||
<fieldset> <input type="submit" name="set" value="Set Configuration" class="btn btn-primary"/></fieldset>
|
||||
|
||||
#(reconnect)#::<div class="alert alert-danger" role="alert">Your Browser will reload the YaCy UI with the new port in 5 seconds...</div>#(/reconnect)#
|
||||
|
||||
</ol>
|
||||
</form>
|
||||
|
|
|
@ -173,8 +173,8 @@ public class ConfigBasic {
|
|||
//yacyAccessible.setNewPortBat(Integer.parseInt(port));
|
||||
//yacyAccessible.setNewPortLink(Integer.parseInt(port));
|
||||
|
||||
// force reconnection in 5 seconds
|
||||
theServerCore.reconnect(5000);
|
||||
// force reconnection in 2 seconds
|
||||
theServerCore.reconnect(2000);
|
||||
} else {
|
||||
reconnect = false;
|
||||
prop.put("reconnect", "0");
|
||||
|
|
|
@ -325,14 +325,19 @@ public class Jetty9HttpServerImpl implements YaCyHttpServer {
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
if (milsec > 0) try {
|
||||
Thread.sleep(milsec);
|
||||
} catch (final InterruptedException e) {
|
||||
ConcurrentLog.logException(e);
|
||||
} catch (final Exception e) {
|
||||
ConcurrentLog.logException(e);
|
||||
}
|
||||
try { // reconnect with new settings (instead to stop/start server, just manipulate connectors
|
||||
try {
|
||||
if (!server.isRunning() || server.isStopped()) {
|
||||
server.start();
|
||||
}
|
||||
|
||||
// reconnect with new settings (instead to stop/start server, just manipulate connectors
|
||||
final Connector[] cons = server.getConnectors();
|
||||
final int port = Switchboard.getSwitchboard().getLocalPort();
|
||||
final int sslport = Switchboard.getSwitchboard().getConfigInt(SwitchboardConstants.SERVER_SSLPORT, 8443);
|
||||
|
@ -512,4 +517,9 @@ public class Jetty9HttpServerImpl implements YaCyHttpServer {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.server.dump() + "\n\n" + this.server.getState();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user