cellect-server 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efa9bdf71d7f86007ecd6f45dbe0f5cf0893f924
4
- data.tar.gz: 07fa08cfb0ff77ad4c099f9ada1a4bebedabb7e1
3
+ metadata.gz: 33f4cba0809d5bc61a3a90b95eac9482c14b9afb
4
+ data.tar.gz: cf0a0020b58f2fb44d0324da237751ed6cc71825
5
5
  SHA512:
6
- metadata.gz: 2733ecff41bcb63e5d5e135e0e68701356e32bce5d02e13110fe009a0c7e00ef28899d83c63a0d4304e145ba4889b648e73f323ba8fe38405daa206ad24ce349
7
- data.tar.gz: b8ec41a5c735f5af7fbc2feb767b023f56d8a35e6a400d037b5a35b376673da538c537ba65fa95bcb606080fc2d8537871c6ff2b536cc3a47912231c36768b75
6
+ metadata.gz: b8d69068b0a37591a6193d37e654cb2b7aea20d57e010696cee9b8ca2b15704884e9b6d2e62818bf3eb8fa9405ae698cb73aace1486c8399f4ef8a23f4fe3260
7
+ data.tar.gz: 47275f4649c67a191657c2b9faa8a8132547cb29b4824ed6be99c1a3055b76f58c8c759701dd428eb954cf2a1704be9d90dffcea71b5ef9bb369bbeeefe8ea18
@@ -17,7 +17,7 @@ module Cellect
17
17
  # Connect to ZooKeeper, setup this node, and change state
18
18
  def initialize_zk
19
19
  # don't let ZK hang the thread, timeout and check connection status
20
- zk = ZK::Client.new zk_url, timeout: 0.5, chroot: '/cellect'
20
+ zk = ZK::Client.new zk_url, timeout: timeout_duration, chroot: '/cellect'
21
21
  raise ConnectionError.new("Can't connect to ZK server.") unless zk.connected?
22
22
  self.zk = zk
23
23
  setup
@@ -30,6 +30,10 @@ module Cellect
30
30
 
31
31
  protected
32
32
 
33
+ def timeout_duration
34
+ ENV.fetch('ZK_TIMEOUT', 5).to_i
35
+ end
36
+
33
37
  def zk_url
34
38
  @zk_url || ENV.fetch('ZK_URL', 'localhost:2181')
35
39
  end
@@ -31,7 +31,7 @@ module Cellect
31
31
  end
32
32
 
33
33
  def _param_to(param, conversion, default)
34
- val = params[param].try conversion
34
+ val = params[param] && params[param].send(conversion)
35
35
  params[param] && val && val > 0 ? val : default
36
36
  end
37
37
  end
@@ -1,3 +1,3 @@
1
1
  module Cellect
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cellect-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Parrish