idlc-sdk-deploy 1.0.0.rc5 → 1.0.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/idlc-sdk-deploy/power.rb +26 -5
- data/lib/idlc-sdk-deploy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0805f4e4ae3a4a7950804f0c5d4a2204c688121a'
|
4
|
+
data.tar.gz: 445b0e06b2265d4bcedc84c98bcdb07d51407935
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 357e09b221657a3b84a46ad3f6d4e7f1f5de9e5f8c2d405b31c0ade1cca8ca8afee75a98e1852905040628fd5f866bad1ba857e3746817eed71c595ff140cd6b
|
7
|
+
data.tar.gz: 1d26441c6408bf9efa9f389d3e31e86c5c7fc85152042eaaf11e8f263954574d18a8bf0c4f4e876d304c82b2661ad14e699d790f0b9803d014565e3e6ad0bbba
|
@@ -33,7 +33,7 @@ module Idlc
|
|
33
33
|
tags: [ # required
|
34
34
|
{
|
35
35
|
key: 'keep_alive',
|
36
|
-
value:
|
36
|
+
value: "true-#{Time.now.to_i}"
|
37
37
|
}
|
38
38
|
]
|
39
39
|
)
|
@@ -127,18 +127,39 @@ module Idlc
|
|
127
127
|
|
128
128
|
def keep_alive?(tags)
|
129
129
|
k = 'false'
|
130
|
+
k = get_keep_alive(tags)
|
130
131
|
|
131
|
-
|
132
|
-
|
133
|
-
|
132
|
+
return !keep_alive_expired?(k) if true?(k.split('-')[0])
|
133
|
+
false
|
134
|
+
end
|
135
|
+
|
136
|
+
def keep_alive_expired?(tag)
|
137
|
+
tag_parts = tag.split('-')
|
134
138
|
|
135
|
-
|
139
|
+
msg("keep_alive expired..") if one_week_old?(tag_parts[1].to_i)
|
140
|
+
msg("keep_alive expires in #{((Time.now.to_i - (tag_parts[1].to_i + (7*24*3600)))/24/3600).abs} days..") unless one_week_old?(tag_parts[1].to_i)
|
141
|
+
|
142
|
+
one_week_old?(tag_parts[1].to_i)
|
136
143
|
end
|
137
144
|
|
138
145
|
def true?(string)
|
139
146
|
string.to_s == 'true'
|
140
147
|
end
|
141
148
|
|
149
|
+
def one_week_old?(ts)
|
150
|
+
(Time.now.to_i - ts) > (7*(24*3600))
|
151
|
+
end
|
152
|
+
|
153
|
+
def get_keep_alive(tags)
|
154
|
+
v = ''
|
155
|
+
|
156
|
+
tags.each do |t|
|
157
|
+
v = t.value if t.key == 'keep_alive'
|
158
|
+
end
|
159
|
+
|
160
|
+
# Return
|
161
|
+
v
|
162
|
+
end
|
142
163
|
|
143
164
|
def http_request(endpoint)
|
144
165
|
uri = URI.parse endpoint
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idlc-sdk-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Cazell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|