fix #720 refresh configuration after restoring data

This commit is contained in:
Shinsuke Sugaya 2016-10-01 10:19:44 +09:00
parent 755679e0e6
commit 1b18c63069
3 changed files with 11 additions and 6 deletions

View file

@ -81,6 +81,7 @@ public class AdminBackupAction extends FessAdminAction {
if (logger.isDebugEnabled()) {
logger.debug("Bulk Response:\n" + response.getContentAsString());
}
systemHelper.reloadConfiguration();
} catch (final Exception e) {
logger.warn("Failed to process bulk file: " + form.bulkFile.getFileName(), e);
}

View file

@ -48,13 +48,9 @@ public class LabelTypeHelper {
protected volatile List<LabelTypePattern> labelTypePatternList;
protected LabelTypeService getLabelTypeService() {
return ComponentUtil.getComponent(LabelTypeService.class);
}
@PostConstruct
public void init() {
final List<LabelType> labelTypeList = getLabelTypeService().getLabelTypeList();
final List<LabelType> labelTypeList = ComponentUtil.getComponent(LabelTypeService.class).getLabelTypeList();
buildLabelTypeItems(labelTypeList);
}
@ -112,7 +108,7 @@ public class LabelTypeHelper {
if (labelTypePatternList == null) {
synchronized (this) {
if (labelTypePatternList == null) {
final List<LabelType> labelTypeList = getLabelTypeService().getLabelTypeList();
final List<LabelType> labelTypeList = ComponentUtil.getComponent(LabelTypeService.class).getLabelTypeList();
final List<LabelTypePattern> list = new ArrayList<>();
for (final LabelType labelType : labelTypeList) {
final String includedPaths = labelType.getIncludedPaths();

View file

@ -290,4 +290,12 @@ public class SystemHelper {
return type + name;
}
public void reloadConfiguration() {
ComponentUtil.getLabelTypeHelper().init();
ComponentUtil.getPathMappingHelper().init();
ComponentUtil.getSuggestHelper().init();
ComponentUtil.getPopularWordHelper().init();
// TODO restart jobs
}
}