From cb2dbcb84319cdbf46f874d35d7add39f536120a Mon Sep 17 00:00:00 2001 From: reger Date: Fri, 18 Oct 2013 00:42:38 +0200 Subject: [PATCH] add graceful Jetty shutdown option - as Jetty stop is not synced, yet - include jetty jars and servlet-3.0 api jar in Eclipse .classpath --- .classpath | 10 +++++++++- source/net/yacy/http/Jetty8HttpServerImpl.java | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.classpath b/.classpath index ed310fa86..d3665f212 100644 --- a/.classpath +++ b/.classpath @@ -13,6 +13,14 @@ + + + + + + + + @@ -34,7 +42,7 @@ - + diff --git a/source/net/yacy/http/Jetty8HttpServerImpl.java b/source/net/yacy/http/Jetty8HttpServerImpl.java index 81b60a722..5bc25f87d 100644 --- a/source/net/yacy/http/Jetty8HttpServerImpl.java +++ b/source/net/yacy/http/Jetty8HttpServerImpl.java @@ -128,6 +128,9 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer { */ @Override public void startupServer() throws Exception { + // option to finish running requests on shutdown + server.setGracefulShutdown(3000); + server.setStopAtShutdown(true); server.start(); } @@ -136,7 +139,7 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer { */ @Override public void stop() throws Exception { - server.stop(); + server.stop(); server.join(); }