rsmp 0.20.3 → 0.20.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rsmp/components.rb +1 -1
- data/lib/rsmp/supervisor_proxy.rb +18 -6
- data/lib/rsmp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4c2f0ad26f341d78dba43980b9f873a75bf06d2233ffa3f27b30b3f7d83e297
|
4
|
+
data.tar.gz: 84187fc4d5c836233397ff20ffff5cdf236435069d3edb436999fe5f8de1436b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1950948c8087db84fbf12069e4fcee10160efa8e4031ba618dcbdf04c130104df5f6e8467f0cfdb647615ab5de3b96fcb7cc9cfeaf5ec458bc0471e9f09676e2
|
7
|
+
data.tar.gz: c9999221cc2b49d5320d2769230e8ba7c9e54bf5a4f4e37c7efdef599b7745f8d85dbb29c2ed7fc01304604e591a5303422e813e9dee978286760e3897705aa2
|
data/Gemfile.lock
CHANGED
data/lib/rsmp/components.rb
CHANGED
@@ -45,7 +45,7 @@ module RSMP
|
|
45
45
|
def find_component component_id, build: true
|
46
46
|
component = @components[component_id]
|
47
47
|
return component if component
|
48
|
-
if build
|
48
|
+
if build && !component_id.empty?
|
49
49
|
inferred = infer_component_type component_id
|
50
50
|
component = inferred.new node: self, id: component_id
|
51
51
|
@components[ component_id] = component
|
@@ -261,19 +261,31 @@ module RSMP
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def process_command_request message
|
264
|
-
log "Received #{message.type}", message: message, level: :log
|
265
264
|
component_id = message.attributes["cId"]
|
266
|
-
component = @site.find_component component_id
|
267
|
-
commands = simplify_command_requests message.attributes["arg"]
|
268
|
-
commands.each_pair do |command_code,arg|
|
269
|
-
component.handle_command command_code,arg
|
270
|
-
end
|
271
265
|
|
272
266
|
rvs = message.attributes["arg"].map do |item|
|
273
267
|
item = item.dup.merge('age'=>'recent')
|
274
268
|
item.delete 'cO'
|
275
269
|
item
|
276
270
|
end
|
271
|
+
|
272
|
+
begin
|
273
|
+
component = @site.find_component component_id
|
274
|
+
commands = simplify_command_requests message.attributes["arg"]
|
275
|
+
commands.each_pair do |command_code,arg|
|
276
|
+
component.handle_command command_code,arg
|
277
|
+
end
|
278
|
+
log "Received #{message.type}", message: message, level: :log
|
279
|
+
rescue UnknownComponent => e
|
280
|
+
log "Received #{message.type} with unknown component id '#{component_id}'", message: message, level: :warning
|
281
|
+
# If the component is unknown, we must set age=undefined for all items,
|
282
|
+
# while still acknowledge the message.
|
283
|
+
# See https://github.com/rsmp-nordic/rsmp_validator/issues/271
|
284
|
+
rvs.map do |item|
|
285
|
+
item['age'] = 'undefined'
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
277
289
|
response = CommandResponse.new({
|
278
290
|
"cId"=>component_id,
|
279
291
|
"cTS"=>clock.to_s,
|
data/lib/rsmp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Tin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|