apiotics 0.1.109 → 0.1.110
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apiotics/server.rb +18 -14
- 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: 1145164092311f82c8e7506c56a9a747c16025f7
|
4
|
+
data.tar.gz: b23fd6e578f516a41caa375168e5b5225bce9ec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff8d1b1faa24fb6e72067c02db166beea45995e10faa5d97a7ffc0b7bbe052b6b93aa582b4942a765433fc05120dbcf22ac510128b3c92e72ef017382f4ba081
|
7
|
+
data.tar.gz: 5e93f6d2e3b60b0c41410a491b5f568538f59b765ba5daa0da2f97d13ac27ddff593145db2b47758e6921d0c30129388caff245134867688a917e576508341ae
|
data/lib/apiotics/server.rb
CHANGED
@@ -99,24 +99,28 @@ module Apiotics
|
|
99
99
|
def listen_remote
|
100
100
|
Thread.abort_on_exception = true
|
101
101
|
Thread.new do
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
if r.
|
111
|
-
r.
|
112
|
-
|
113
|
-
|
102
|
+
begin
|
103
|
+
loop do
|
104
|
+
msg = @server.gets
|
105
|
+
puts msg
|
106
|
+
msg_hash = Apiotics::Parse.message(msg)
|
107
|
+
unless msg_hash["driver"] == "Core::Heartbeat"
|
108
|
+
r = Apiotics::Insert.new(msg_hash)
|
109
|
+
puts "Message received": msg_hash
|
110
|
+
if r.valid == true
|
111
|
+
if r.action == "set-request-ack" || r.action == "set-complete" || r.action == "get-ack"
|
112
|
+
r.save
|
113
|
+
unless Apiotics.configuration.local_logging == false
|
114
|
+
r.save_log
|
115
|
+
end
|
114
116
|
end
|
115
117
|
end
|
118
|
+
else
|
119
|
+
monitor_heartbeat(msg_hash)
|
116
120
|
end
|
117
|
-
else
|
118
|
-
monitor_heartbeat(msg_hash)
|
119
121
|
end
|
122
|
+
rescue => e
|
123
|
+
puts e
|
120
124
|
end
|
121
125
|
ActiveRecord::Base.connection.close
|
122
126
|
end
|
data/lib/apiotics/version.rb
CHANGED