Skip to content

Commit

Permalink
是否使用redis的发布订阅服务来实时检测HTTP资源变更
Browse files Browse the repository at this point in the history
  • Loading branch information
ysc committed May 25, 2018
1 parent 843742b commit a43cea6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ word 1.3.1这个版本是从代码分支[ForElasticsearch1.7.2](https://github.c
#数量词
quantifier.path=http://localhost:8080/word_web/resources/quantifier.txt

#是否使用redis的发布订阅服务来实时检测HTTP资源变更
redis.enable=false
#redis服务,用于实时检测HTTP资源变更
#redis主机
redis.host=localhost
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/apdplat/word/util/AutoDetector.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ private static List<String> loadHttpResource(String resource, ResourceLoader res
result.add(line);
}
}
watchHttp(resource, resourceLoader);
String redisEnable = WordConfTools.get("redis.enable", "true");
if("true".equalsIgnoreCase(redisEnable)) {
watchHttp(resource, resourceLoader);
}
return result;
}
private static void watchHttp(String resource, final ResourceLoader resourceLoader){
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/word.conf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ recognition.tool.enabled=true
#dic.dump.path=dic.dump.txt
#dic.dump.path=/Users/ysc/dic.dump.txt
dic.dump.path=
#是否使用redis的发布订阅服务来实时检测HTTP资源变更
redis.enable=false
#redis服务,用于实时检测HTTP资源变更
#redis主机
redis.host=localhost
Expand Down

0 comments on commit a43cea6

Please sign in to comment.