*) Improvements for restart via update wrapper

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3785 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
(no author) 18 years ago
parent 54ddb3262c
commit 94cc9f05f5

@ -73,7 +73,7 @@ public class Steering {
}
if (post.containsKey("shutdown")) {
if (sb.updaterCallback != null) { sb.updaterCallback.signalYaCyShutdown(); }
if (sb.updaterCallback != null) { sb.setConfig("Updater.restartSignal", 0); }
sb.terminate(3000);
prop.put("info", 3);
return prop;
@ -94,9 +94,9 @@ public class Steering {
}
if (sb.updaterCallback != null) {
sb.updaterCallback.signalYaCyRestart();
sb.setConfig("Updater.shutdownSignal", 1);
} else {
serverLog.logWarning("SHUTDOWN", "ERROR: no wrapper/updater running! Performing a normal shutdown...");
serverLog.logWarning("SHUTDOWN", "No wrapper/updater running! Performing a normal shutdown...");
}
sb.terminate(5000);

@ -1679,8 +1679,14 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
errorURL.close();
wordIndex.close();
yc.close();
// signal shudown to the updater
if (updaterCallback != null) updaterCallback.signalYaCyShutdown();
// signal shutdown to the updater
if (updaterCallback != null) {
if (sb.getConfigLong("Updater.shutdownSignal", -1) == 0)
updaterCallback.signalYaCyShutdown();
else if
(sb.getConfigLong("Updater.shutdownSignal", -1) == 1)
updaterCallback.signalYaCyRestart();
}
log.logConfig("SWITCHBOARD SHUTDOWN TERMINATED");
}
@ -1691,7 +1697,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public void enQueue(Object job) {
if (!(job instanceof plasmaSwitchboardQueue.Entry)) {
System.out.println("internal error at plasmaSwitchboard.enQueue: wrong job type");
System.out.println("Internal error at plasmaSwitchboard.enQueue: wrong job type");
System.exit(0);
}
try {

@ -6,6 +6,7 @@ public interface serverUpdaterCallback {
public String getYaCyUpdateReleaseVersion();
//public File getYaCyUpdateReleaseFile();
public String getYaCyUpdateSource();
/** Signal a user initiated YaCy shutdown (not restart!) to the updater so it can terminate itself */
public void signalYaCyShutdown();
public void signalYaCyRestart();
}
Loading…
Cancel
Save