apiotics 0.1.91 → 0.1.92
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 +4 -4
- data/lib/apiotics/server.rb +9 -7
- data/lib/apiotics/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 848fddae9f407adbe9dd7f6c3e68ddd43b3ec5de
|
4
|
+
data.tar.gz: 21f8df6427cb0022234c60dec519c3fb1c6474c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f6aa325de320d778a3561aa492f1030351f6247b6497f23991d0257009c08b150b3cf6ea9ed531ec2addb1b2d6f1393381b5ef43a67c7f4fc84934067803bb4
|
7
|
+
data.tar.gz: ba66b668e4803335290167e55cf7ba8ffe89c6fc752ccece5c8478dcbd3d0bd8b6d797a99d74729d37ddaa4a6ad7f5659fa23837058c42e06d2da286a71f7c0e
|
data/lib/apiotics/server.rb
CHANGED
@@ -69,7 +69,6 @@ module Apiotics
|
|
69
69
|
@server = server
|
70
70
|
@localport = Apiotics.configuration.local_port
|
71
71
|
listen_remote
|
72
|
-
listen_local
|
73
72
|
@heartbeat_state = Hash.new
|
74
73
|
heartbeat = {
|
75
74
|
"action" => "set-request",
|
@@ -78,7 +77,7 @@ module Apiotics
|
|
78
77
|
"interface" => nil
|
79
78
|
}
|
80
79
|
send_heartbeat(heartbeat)
|
81
|
-
|
80
|
+
listen_local
|
82
81
|
end
|
83
82
|
|
84
83
|
def send(msg)
|
@@ -162,11 +161,14 @@ module Apiotics
|
|
162
161
|
end
|
163
162
|
|
164
163
|
def send_heartbeat(heartbeat)
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
164
|
+
Thread.new do
|
165
|
+
loop do
|
166
|
+
heartbeat["interface"] = DateTime.now.to_i
|
167
|
+
self.send(heartbeat)
|
168
|
+
self.monitor_heartbeat(heartbeat)
|
169
|
+
sleep Apiotics.configuration.heartbeat_interval
|
170
|
+
end
|
171
|
+
ActiveRecord::Base.connection.close
|
170
172
|
end
|
171
173
|
end
|
172
174
|
|
data/lib/apiotics/version.rb
CHANGED