Commit f87c7c2c by dongfeng

fix readme.md && version

parent 7abc85bb
PATH PATH
remote: . remote: .
specs: specs:
crm_java_search (0.1.3) crm_java_search (0.3)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
......
...@@ -22,7 +22,19 @@ Or install it yourself as: ...@@ -22,7 +22,19 @@ Or install it yourself as:
## Usage ## Usage
TODO: Write usage instructions here 在cofig 文件下新建文件crm_java_search.rb, 读取相关配置:
```ruby
# 配置文件例子
# es:
# enabled: true
# search_enabled: true
# check_enabled: true
# sync_enabled: true
# host: 'http://dev-pc-search.ikcrm.com'
crm_java_search_config = HashWithIndifferentAccess.new YAML.load_file("#{Rails.root}/config/microservices.yml")[Rails.env]['es']
CrmJavaSearch::Config.init(crm_java_search_config)
```
## Development ## Development
......
...@@ -20,6 +20,5 @@ end ...@@ -20,6 +20,5 @@ end
Dir[File.dirname(__FILE__) + '/crm_java_search/agents/*.rb'].sort.each do |path| Dir[File.dirname(__FILE__) + '/crm_java_search/agents/*.rb'].sort.each do |path|
filename = File.basename(path) filename = File.basename(path)
p filename
require "crm_java_search/agents/#{filename}" require "crm_java_search/agents/#{filename}"
end end
...@@ -34,7 +34,6 @@ module CrmJavaSearch ...@@ -34,7 +34,6 @@ module CrmJavaSearch
checker = "CrmJavaSearch::Checkers::#{@klass}Checker".constantize.new(user: user, entity: record, params: dup_params) checker = "CrmJavaSearch::Checkers::#{@klass}Checker".constantize.new(user: user, entity: record, params: dup_params)
checker.check checker.check
Log.logger.info("Checkers::ApiCheckService checker: #{checker.inspect}") Log.logger.info("Checkers::ApiCheckService checker: #{checker.inspect}")
if ['1', '2'].include?(checker.result[:code]) if ['1', '2'].include?(checker.result[:code])
message = checker.result[:remark] message = checker.result[:remark]
......
...@@ -8,11 +8,11 @@ module CrmJavaSearch ...@@ -8,11 +8,11 @@ module CrmJavaSearch
def default_settings def default_settings
{ {
enabled: true, enabled: false,
search_enabled: true, search_enabled: false,
check_enabled: true, check_enabled: false,
sync_enabled: true, sync_enabled: false,
host: 'http://dev-pc-search.ikcrm.com' host: ''
}.with_indifferent_access }.with_indifferent_access
end end
......
...@@ -15,6 +15,7 @@ module CrmJavaSearch ...@@ -15,6 +15,7 @@ module CrmJavaSearch
end_time = Time.now.getlocal end_time = Time.now.getlocal
Log.logger.info("start_time: #{start_time} end_time: #{end_time}") Log.logger.info("start_time: #{start_time} end_time: #{end_time}")
Log.logger.info("ESRequest Time: #{end_time - start_time} ") Log.logger.info("ESRequest Time: #{end_time - start_time} ")
Log.logger.info("res: #{res}")
res res
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment