You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2018/11/06 15:40:53 UTC

[GitHub] karlpauls closed pull request #5: Configurable shutdown grace time.

karlpauls closed pull request #5: Configurable shutdown grace time.
URL: https://github.com/apache/sling-org-apache-sling-feature-launcher/pull/5
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java
index 25ce117..7546b02 100644
--- a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java
+++ b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java
@@ -34,6 +34,8 @@
  */
 public class FrameworkRunner extends AbstractRunner {
 
+    private static final String SHUTDOWN_GRACE_TIME = "sling.framework.shutdown.graceTime";
+
     private volatile int type = -1;
 
     public FrameworkRunner(final Map<String, String> frameworkProperties,
@@ -57,12 +59,13 @@ public FrameworkRunner(final Map<String, String> frameworkProperties,
         // initialize the framework
         framework.init();
 
+        long graceTime = Long.parseLong(frameworkProperties.getOrDefault(SHUTDOWN_GRACE_TIME, "60000"));
         Runtime.getRuntime().addShutdownHook(new Thread() {
             @Override
             public void run() {
                 try {
                     framework.stop();
-                    FrameworkEvent waitForStop = framework.waitForStop(60 * 1000);
+                    FrameworkEvent waitForStop = framework.waitForStop(graceTime);
                     if (waitForStop.getType() != FrameworkEvent.STOPPED)
                     {
                         Main.LOG().warn("Framework stopped with: " + waitForStop.getType(), waitForStop.getThrowable());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services