fix #1304 add Config Reloader

This commit is contained in:
Shinsuke Sugaya 2017-10-12 14:17:11 +09:00
parent f98f7fc8c6
commit 8c1389b2e1
4 changed files with 18 additions and 1 deletions

View file

@ -51,6 +51,10 @@ public class LabelTypeHelper {
@PostConstruct
public void init() {
update();
}
public void update() {
final List<LabelType> labelTypeList = ComponentUtil.getComponent(LabelTypeService.class).getLabelTypeList();
buildLabelTypeItems(labelTypeList);
}

View file

@ -43,6 +43,10 @@ public class PathMappingHelper {
@PostConstruct
public void init() {
update();
}
public void update() {
final List<String> ptList = new ArrayList<>();
ptList.add(Constants.PROCESS_TYPE_DISPLAYING);
ptList.add(Constants.PROCESS_TYPE_BOTH);

View file

@ -355,6 +355,13 @@ public class SystemHelper {
ComponentUtil.getRelatedQueryHelper().update();
}
public void updateConfiguration() {
ComponentUtil.getLabelTypeHelper().update();
ComponentUtil.getPathMappingHelper().update();
ComponentUtil.getRelatedContentHelper().update();
ComponentUtil.getRelatedQueryHelper().update();
}
public String generateAccessToken() {
return RandomStringUtils.random(ComponentUtil.getFessConfig().getApiAccessTokenLengthAsInteger().intValue(), 0, 0, true, true,
null, random);

View file

@ -12,5 +12,7 @@
{"name":"Thumbnail Generator","target":"all","cronExpression":"* * * * *","scriptType":"groovy","scriptData":"return container.getComponent(\"generateThumbnailJob\").execute();","jobLogging":false,"crawler":false,"available":true,"sortOrder":6,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
{"index":{"_index":".fess_config","_type":"scheduled_job","_id":"thumbnail_purger"}}
{"name":"Thumbnail Purger","target":"all","cronExpression":"0 0 * * *","scriptType":"groovy","scriptData":"return container.getComponent(\"purgeThumbnailJob\").expiry(30 * 24 * 60 * 60 * 1000L).execute();","jobLogging":true,"crawler":false,"available":true,"sortOrder":7,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
{"index":{"_index":".fess_config","_type":"scheduled_job","_id":"reload_config"}}
{"name":"Config Reloader","target":"all","cronExpression":"*/10 * * * *","scriptType":"groovy","scriptData":"return container.getComponent(\"systemHelper\").updateConfiguration();","jobLogging":false,"crawler":false,"available":true,"sortOrder":8,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
{"index":{"_index":".fess_config","_type":"scheduled_job","_id":"ping_es"}}
{"name":"Ping Elasticsearch","target":"all","cronExpression":"* * * * *","scriptType":"groovy","scriptData":"return container.getComponent(\"pingEsJob\").execute();","jobLogging":false,"crawler":false,"available":true,"sortOrder":8,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}
{"name":"Ping Elasticsearch","target":"all","cronExpression":"* * * * *","scriptType":"groovy","scriptData":"return container.getComponent(\"pingEsJob\").execute();","jobLogging":false,"crawler":false,"available":true,"sortOrder":9,"createdBy":"system","createdTime":0,"updatedBy":"system","updatedTime":0}