omf_rc_shm 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/omf_rc/resource_proxy/shm_node.rb +18 -18
- data/lib/omf_rc_shm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjRiMjIzZmRmNGJmNzA1MmNjN2I2NDEzZGQ0YzliMDI3YmFjMzE1Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzI5YTViNmI2OGUyODBmNDIxNjc2YmI3NDllY2M5NmVkMzBhNjE3Nw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWQ3MzdiZGVmNTA4YjBjMDQwYjQ4YjM5MDAzMDFkZGZjZGY1YTM4ZWEzZTBi
|
10
|
+
NDRkYzAwOTUxNjJhMTViMjhjNWRkNWFlMTVjMzBkNWU2ZDA2NmU0OTFhNzll
|
11
|
+
YThmMTQ2OWRiY2Y3YTExNDA1NGViMWFlODRmMmIwODU1MmIzNjY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGE4YTZhMmMxYzk0MDE5MjEzM2RiOTg4YWQ2ZTk2MjQ0Y2NiN2QyODg1ZTdk
|
14
|
+
OTZiYzUyNmY5Njk5NGIzOTBiMDUzZGQ4ODBmYmM0NDRjZDM3MTViYmU3OTc4
|
15
|
+
YWFiMzUxODY5NmIyOTVjZWVhYjk3YWRmMjYzMDhmOTc0ZTY3MDI=
|
@@ -23,28 +23,28 @@ module OmfRc::ResourceProxy::ShmNode
|
|
23
23
|
unless node.property.time_sync_tries.nil?
|
24
24
|
require 'net/ntp'
|
25
25
|
info "Option 'time_sync_tries' is set. Continue only if local time is accurate, will try to sync #{node.property.time_sync_tries} times with random wait of up to #{node.property.time_sync_interval}s."
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
dt = node.property.time_sync_maxdrift.to_i + 1
|
27
|
+
lt = rt = t = 0
|
28
|
+
while dt >node.property.time_sync_maxdrift.to_i do
|
29
|
+
t = t+1
|
30
30
|
begin
|
31
31
|
lt = Time.now ; rt = Net::NTP.get.time ; dt = (lt-rt).abs
|
32
|
-
|
32
|
+
if dt > node.property.time_sync_maxdrift.to_i
|
33
|
+
info "Time sync try #{t} - Local: #{lt.to_i} - NTP: #{rt.to_i} - Diff: #{dt} - (sync: #{node.property.time_sync_cmd.to_s})"
|
34
|
+
res = `#{node.property.time_sync_cmd.to_s}`
|
35
|
+
sleep(rand(node.property.time_sync_interval.to_i))
|
36
|
+
else
|
37
|
+
break
|
38
|
+
end
|
39
|
+
rescue Exception => e
|
33
40
|
info "Time sync try #{i} - Cannot contact NTP server (#{e})"
|
41
|
+
sleep(rand(node.property.time_sync_interval.to_i))
|
34
42
|
end
|
35
|
-
if
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
sleep(rand(node.property.time_sync_interval.to_i))
|
42
|
-
end
|
43
|
-
lt = Time.now ; rt = Net::NTP.get.time ; dt = (lt-rt).abs
|
44
|
-
if dt > node.property.time_sync_maxdrift.to_i
|
45
|
-
info "Time sync FAILED! EXITING NOW!"
|
46
|
-
exit
|
47
|
-
end
|
43
|
+
if t > node.property.time_sync_tries.to_i
|
44
|
+
info "Time sync FAILED! EXITING NOW!"
|
45
|
+
exit
|
46
|
+
end
|
47
|
+
end
|
48
48
|
info "Time sync OK - Local: #{lt.to_i} - NTP: #{rt.to_i} - Diff: #{dt}"
|
49
49
|
end
|
50
50
|
# 2) if present, load and set default app schedule
|
data/lib/omf_rc_shm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omf_rc_shm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NICTA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|