Commit f87c7c2c by dongfeng

fix readme.md && version

parent 7abc85bb
PATH
remote: .
specs:
crm_java_search (0.1.3)
crm_java_search (0.3)
GEM
remote: https://rubygems.org/
......
......@@ -22,7 +22,19 @@ Or install it yourself as:
## 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
......
......@@ -20,6 +20,5 @@ end
Dir[File.dirname(__FILE__) + '/crm_java_search/agents/*.rb'].sort.each do |path|
filename = File.basename(path)
p filename
require "crm_java_search/agents/#{filename}"
end
......@@ -34,7 +34,6 @@ module CrmJavaSearch
checker = "CrmJavaSearch::Checkers::#{@klass}Checker".constantize.new(user: user, entity: record, params: dup_params)
checker.check
Log.logger.info("Checkers::ApiCheckService checker: #{checker.inspect}")
if ['1', '2'].include?(checker.result[:code])
message = checker.result[:remark]
......
......@@ -8,11 +8,11 @@ module CrmJavaSearch
def default_settings
{
enabled: true,
search_enabled: true,
check_enabled: true,
sync_enabled: true,
host: 'http://dev-pc-search.ikcrm.com'
enabled: false,
search_enabled: false,
check_enabled: false,
sync_enabled: false,
host: ''
}.with_indifferent_access
end
......
......@@ -15,6 +15,7 @@ module CrmJavaSearch
end_time = Time.now.getlocal
Log.logger.info("start_time: #{start_time} end_time: #{end_time}")
Log.logger.info("ESRequest Time: #{end_time - start_time} ")
Log.logger.info("res: #{res}")
res
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