nutcracker-web 0.0.17 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9a985e8c590de7322c9aba8b76e3f0cd7ac286738156af5bee85edff2546c87
4
- data.tar.gz: 883fda9650e3608d2a21c1358b97ab07b7393c51db6706ac7a7740bbd00bf7bb
3
+ metadata.gz: 2e70d2a5e6a87730d2ad90905a8da57cf3269475dc85be6666306283fe5296df
4
+ data.tar.gz: a9f60bf120fa16a5ce1413d0c465044e75f9b1fcb157e932a1b6f7ec3b36c47e
5
5
  SHA512:
6
- metadata.gz: bcd88671030e3c1de448b48e46be40adb15b8214fb23d9c9c45584859a36b7542d2543f4f3dc33d9faf4ec96f0b7fe5d20f31ee5be7c7a232c0bb75cb59a4d97
7
- data.tar.gz: a503ea353b0f45b4274749e9a9117ff8f5a8a2fb8e433857cd4df78bc2d526ca05c683f7aab4c43b7c36a22ea788efe1627c8c1ea32ab0cdc80f3fa7f01c7fe4
6
+ metadata.gz: 8498dfc5396afc100f27b84ff3fe9a47d4384b0c60388bf8d85b2ae89fcc7719ca9a2b390813f4a1dc2294a032ac23d39dd18f21a4ac9e64d7926b5287585e3b
7
+ data.tar.gz: cfa689fb43a17c8de1b277beb4b3bf40881916257e5f6652cd1a38f6707ef39424a1827d906d26151959bef4074b569383183fa9a7d2c49ca138cbc2726e5295
data/Gemfile CHANGED
@@ -10,3 +10,4 @@ gem 'uglifier'
10
10
  gem 'nutcracker', ">=0.4.1.20"
11
11
  gem "rack", ">= 2.0.8"
12
12
  gem 'rake'
13
+ gem 'gem-release'
data/Gemfile.lock CHANGED
@@ -6,7 +6,7 @@ GEM
6
6
  execjs
7
7
  coffee-script-source (1.12.2)
8
8
  concurrent-ruby (1.0.5)
9
- daemons (1.2.6)
9
+ daemons (1.4.1)
10
10
  eco (1.0.0)
11
11
  coffee-script
12
12
  eco-source
@@ -14,6 +14,7 @@ GEM
14
14
  eco-source (1.1.0.rc.1)
15
15
  eventmachine (1.2.7)
16
16
  execjs (2.7.0)
17
+ gem-release (2.2.2)
17
18
  haml (5.0.4)
18
19
  temple (>= 0.8.0)
19
20
  tilt
@@ -34,7 +35,7 @@ GEM
34
35
  concurrent-ruby (~> 1.0)
35
36
  rack (> 1, < 3)
36
37
  temple (0.8.0)
37
- thin (1.7.2)
38
+ thin (1.8.1)
38
39
  daemons (~> 1.0, >= 1.0.9)
39
40
  eventmachine (~> 1.0, >= 1.0.4)
40
41
  rack (>= 1, < 3)
@@ -48,6 +49,7 @@ PLATFORMS
48
49
  DEPENDENCIES
49
50
  coffee-script
50
51
  eco
52
+ gem-release
51
53
  haml
52
54
  nutcracker (>= 0.4.1.20)
53
55
  rack (>= 2.0.8)
@@ -58,4 +60,4 @@ DEPENDENCIES
58
60
  uglifier
59
61
 
60
62
  BUNDLED WITH
61
- 1.17.2
63
+ 1.17.3
@@ -25,15 +25,21 @@ module Nutcracker
25
25
  end
26
26
 
27
27
  get '/status' do
28
- @nutcracker.
28
+ # return array of maps each map is {instance_ip => [unresposive_node_ports],instance_ip => [unresposive_node_ports]}
29
+ # exaple: [{"127.0.0.1"=>["6370", "6371", "6372", "6373"]}, {"192.168.1.114"=>["6370"]}]
30
+ unresponsive_ndoes = @nutcracker.
29
31
  config.
30
32
  values.
31
33
  map {|x| x["servers"] + [x["listen"]]}.
32
34
  flatten.
33
35
  map {|x| x.split(":")}.
34
- map {|host, port| Thread.new {TCPSocket.new(host,port).close.nil? rescue false}}.map(&:value).
35
- all?.
36
- tap {|x| status(x ? 200 : 401)}
36
+ map {|host, port| Thread.new {TCPSocket.new(host,port).close.nil? rescue {:host=>host,:port=>port} } }.
37
+ map(&:value).
38
+ group_by{|k| k[:host]}.
39
+ map {|k,v| [k=>v.map { |v| v[:port] }] }.
40
+ flatten
41
+ #if there are unresposive_node in the list return status 401, if empty return 200
42
+ status = unresponsive_ndoes.empty?.tap {|x| status(x ? 200 : 401)}
37
43
  end
38
44
 
39
45
  get '/overview.json' do
@@ -1,5 +1,5 @@
1
1
  module Nutcracker
2
2
  module Web
3
- VERSION="0.0.17"
3
+ VERSION="0.0.19"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutcracker-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eran Barak Levi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-23 00:00:00.000000000 Z
11
+ date: 2021-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -123,8 +123,6 @@ files:
123
123
  - lib/nutcracker/web.rb
124
124
  - lib/nutcracker/web/app.rb
125
125
  - lib/nutcracker/web/version.rb
126
- - public/assets/application.css
127
- - public/assets/application.js
128
126
  homepage: http://www.kontera.com
129
127
  licenses: []
130
128
  metadata: {}
@@ -143,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
141
  - !ruby/object:Gem::Version
144
142
  version: '0'
145
143
  requirements: []
146
- rubygems_version: 3.0.8
144
+ rubygems_version: 3.0.9
147
145
  signing_key:
148
146
  specification_version: 4
149
147
  summary: Nutcracker Web Interface