cf_light_api 3.0.0.pre6 → 3.0.0.pre7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cf_light_api/worker.rb +6 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4a2eff7494596e20ab722293c1df794fddc66d4
4
- data.tar.gz: 6d2ad90268e818965936481e7df8fda694272d83
3
+ metadata.gz: 4fc46c1079a49968ee02e06f43c3d8169111129b
4
+ data.tar.gz: e84870573c9444a96ca09e8ab8b221c4db4efe5a
5
5
  SHA512:
6
- metadata.gz: c56d5ba416319fa6113a855fe851a29671db22647bd32664492ede6731e39a7bde0cb596dc2e323705ae972a3430bb7c108037b98d09fbd0a82d090feb373fc6
7
- data.tar.gz: 96a6a2a8d2e9480fb92e6ad5ae655ea939c4006e86100ce5b003be391ad912f07f525aabb75aac18c90e935bfdf96c79cdb7e586d8a21ded5923f347996096a3
6
+ metadata.gz: a0a2ecfa7d75d95d8c1b4a8de1a054cc84b8c193575d951f76cca46320874b8e76424bd84935f44eccf694a4c36e123ee2d1ae565a8e1aa86de9fc79bad3d87f
7
+ data.tar.gz: 0d672a8bc39ebae011a81c123eb30a446683eeacf4475a31a8cc74cf5e198f6063d9e0724ee11e3c4aef3028b08852ab53e6f68ae29cbe8cfc0a0aa28c57d278
@@ -355,18 +355,19 @@ class CFLightAPIWorker
355
355
  v2_document['instances'] = instances
356
356
  end
357
357
 
358
+ # We consider an app to be "running" if there is at least one app instance available with a state of "RUNNING"
358
359
  running = false
360
+ running_instances = []
359
361
  if v2_document['instances'].any?
360
- if v2_document['instances'].select{|instance| instance['state'] == 'RUNNING'}.any?
361
- running = true
362
- end
362
+ running_instances = v2_document['instances'].select{|instance| instance['state'] == 'RUNNING'}
363
+ running = true if running_instances.any?
363
364
  end
364
365
  v1_document['running'] = running
365
366
  v2_document['running'] = running
366
367
 
367
368
  if @graphite
368
- if v2_document['instances'].any?
369
- send_instance_usage_data_to_graphite(instances, v2_document['org'], v2_document['space'], v2_document['name'])
369
+ if running_instances.any?
370
+ send_instance_usage_data_to_graphite(running_instances, v2_document['org'], v2_document['space'], v2_document['name'])
370
371
  end
371
372
  end
372
373
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf_light_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre6
4
+ version: 3.0.0.pre7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Springer Platform Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-23 00:00:00.000000000 Z
11
+ date: 2018-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cfoundry