diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java
index 06201ab16..993e21545 100644
--- a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java
+++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java
@@ -768,6 +768,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
/** The key of the configuration. e.g. png */
String THUMBNAIL_HTML_IMAGE_FORMAT = "thumbnail.html.image.format";
+ /** The key of the configuration. e.g. 0 */
+ String THUMBNAIL_GENERATOR_INTERVAL = "thumbnail.generator.interval";
+
/** The key of the configuration. e.g. all */
String THUMBNAIL_GENERATOR_TARGETS = "thumbnail.generator.targets";
@@ -3771,6 +3774,21 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
*/
String getThumbnailHtmlImageFormat();
+ /**
+ * Get the value for the key 'thumbnail.generator.interval'.
+ * The value is, e.g. 0
+ * @return The value of found property. (NotNull: if not found, exception but basically no way)
+ */
+ String getThumbnailGeneratorInterval();
+
+ /**
+ * Get the value for the key 'thumbnail.generator.interval' as {@link Integer}.
+ * The value is, e.g. 0
+ * @return The value of found property. (NotNull: if not found, exception but basically no way)
+ * @throws NumberFormatException When the property is not integer.
+ */
+ Integer getThumbnailGeneratorIntervalAsInteger();
+
/**
* Get the value for the key 'thumbnail.generator.targets'.
* The value is, e.g. all
@@ -6353,6 +6371,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
return get(FessConfig.THUMBNAIL_HTML_IMAGE_FORMAT);
}
+ public String getThumbnailGeneratorInterval() {
+ return get(FessConfig.THUMBNAIL_GENERATOR_INTERVAL);
+ }
+
+ public Integer getThumbnailGeneratorIntervalAsInteger() {
+ return getAsInteger(FessConfig.THUMBNAIL_GENERATOR_INTERVAL);
+ }
+
public String getThumbnailGeneratorTargets() {
return get(FessConfig.THUMBNAIL_GENERATOR_TARGETS);
}
diff --git a/src/main/java/org/codelibs/fess/thumbnail/ThumbnailManager.java b/src/main/java/org/codelibs/fess/thumbnail/ThumbnailManager.java
index 1550a3e8e..55d152b8e 100644
--- a/src/main/java/org/codelibs/fess/thumbnail/ThumbnailManager.java
+++ b/src/main/java/org/codelibs/fess/thumbnail/ThumbnailManager.java
@@ -211,6 +211,11 @@ public class ThumbnailManager {
}
if (!generator.generate(entity.getThumbnailId(), entity.getUrl(), outputFile)) {
new File(outputFile.getAbsolutePath() + NOIMAGE_FILE_SUFFIX).setLastModified(System.currentTimeMillis());
+ } else {
+ long interval = fessConfig.getThumbnailGeneratorIntervalAsInteger().longValue();
+ if (interval > 0) {
+ Thread.sleep(interval);
+ }
}
} else if (logger.isDebugEnabled()) {
logger.debug("No image file exists: " + noImageFile.getAbsolutePath());
diff --git a/src/main/resources/fess_config.properties b/src/main/resources/fess_config.properties
index c742b2718..721afe7a5 100644
--- a/src/main/resources/fess_config.properties
+++ b/src/main/resources/fess_config.properties
@@ -392,6 +392,7 @@ thumbnail.html.image.window.height=800
thumbnail.html.image.thumbnail.width=100
thumbnail.html.image.thumbnail.height=100
thumbnail.html.image.format=png
+thumbnail.generator.interval=0
thumbnail.generator.targets=all
thumbnail.crawler.enabled=true