Pārlūkot izejas kodu

fix #2266 add thumbnail.system.monitor.interval

Shinsuke Sugaya 5 gadi atpakaļ
vecāks
revīzija
ca4ddb43d9

+ 1 - 0
src/main/java/org/codelibs/fess/exec/Crawler.java

@@ -289,6 +289,7 @@ public class Crawler {
 
     private static void destroyContainer() {
         if (running.getAndSet(false)) {
+            TimeoutManager.getInstance().stop();
             if (logger.isDebugEnabled()) {
                 logger.debug("Destroying LaContainer...");
             }

+ 1 - 0
src/main/java/org/codelibs/fess/exec/SuggestCreator.java

@@ -155,6 +155,7 @@ public class SuggestCreator {
     }
 
     private static void destroyContainer() {
+        TimeoutManager.getInstance().stop();
         synchronized (SingletonLaContainerFactory.class) {
             SingletonLaContainerFactory.destroy();
         }

+ 2 - 1
src/main/java/org/codelibs/fess/exec/ThumbnailGenerator.java

@@ -137,7 +137,7 @@ public class ThumbnailGenerator {
 
             systemMonitorTask =
                     TimeoutManager.getInstance().addTimeoutTarget(new SystemMonitorTarget(),
-                            ComponentUtil.getFessConfig().getSuggestSystemMonitorIntervalAsInteger(), true);
+                            ComponentUtil.getFessConfig().getThumbnailSystemMonitorIntervalAsInteger(), true);
 
             final int totalCount = process(options);
             if (totalCount != 0) {
@@ -167,6 +167,7 @@ public class ThumbnailGenerator {
     }
 
     private static void destroyContainer() {
+        TimeoutManager.getInstance().stop();
         synchronized (SingletonLaContainerFactory.class) {
             SingletonLaContainerFactory.destroy();
         }

+ 27 - 0
src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java

@@ -1067,6 +1067,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
     /** The key of the configuration. e.g. true */
     String THUMBNAIL_CRAWLER_ENABLED = "thumbnail.crawler.enabled";
 
+    /** The key of the configuration. e.g. 60 */
+    String THUMBNAIL_SYSTEM_MONITOR_INTERVAL = "thumbnail.system.monitor.interval";
+
     /** The key of the configuration. e.g. userCode */
     String USER_CODE_REQUEST_PARAMETER = "user.code.request.parameter";
 
@@ -4943,6 +4946,21 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
      */
     boolean isThumbnailCrawlerEnabled();
 
+    /**
+     * Get the value for the key 'thumbnail.system.monitor.interval'. <br>
+     * The value is, e.g. 60 <br>
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     */
+    String getThumbnailSystemMonitorInterval();
+
+    /**
+     * Get the value for the key 'thumbnail.system.monitor.interval' as {@link Integer}. <br>
+     * The value is, e.g. 60 <br>
+     * @return The value of found property. (NotNull: if not found, exception but basically no way)
+     * @throws NumberFormatException When the property is not integer.
+     */
+    Integer getThumbnailSystemMonitorIntervalAsInteger();
+
     /**
      * Get the value for the key 'user.code.request.parameter'. <br>
      * The value is, e.g. userCode <br>
@@ -7912,6 +7930,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             return is(FessConfig.THUMBNAIL_CRAWLER_ENABLED);
         }
 
+        public String getThumbnailSystemMonitorInterval() {
+            return get(FessConfig.THUMBNAIL_SYSTEM_MONITOR_INTERVAL);
+        }
+
+        public Integer getThumbnailSystemMonitorIntervalAsInteger() {
+            return getAsInteger(FessConfig.THUMBNAIL_SYSTEM_MONITOR_INTERVAL);
+        }
+
         public String getUserCodeRequestParameter() {
             return get(FessConfig.USER_CODE_REQUEST_PARAMETER);
         }
@@ -8880,6 +8906,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
             defaultMap.put(FessConfig.THUMBNAIL_GENERATOR_INTERVAL, "0");
             defaultMap.put(FessConfig.THUMBNAIL_GENERATOR_TARGETS, "all");
             defaultMap.put(FessConfig.THUMBNAIL_CRAWLER_ENABLED, "true");
+            defaultMap.put(FessConfig.THUMBNAIL_SYSTEM_MONITOR_INTERVAL, "60");
             defaultMap.put(FessConfig.USER_CODE_REQUEST_PARAMETER, "userCode");
             defaultMap.put(FessConfig.USER_CODE_MIN_LENGTH, "20");
             defaultMap.put(FessConfig.USER_CODE_MAX_LENGTH, "100");

+ 1 - 0
src/main/resources/fess_config.properties

@@ -551,6 +551,7 @@ thumbnail.html.image.exclude.extensions=svg,html,css,js
 thumbnail.generator.interval=0
 thumbnail.generator.targets=all
 thumbnail.crawler.enabled=true
+thumbnail.system.monitor.interval=60
 
 # user
 user.code.request.parameter=userCode