cf_light_api 1.6.3 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sinatra/cf_light_api.rb +13 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14af134ef675a127dd3ecb69207b31cb84a8f62b
4
- data.tar.gz: 8d95ba75469242f77e6d3cfa94b525ba07b5e3fd
3
+ metadata.gz: b2b445bb4b226594c287865ab11856d26ead5ef2
4
+ data.tar.gz: c35504e2c5c7650b80d8646370f199a993f9f9b8
5
5
  SHA512:
6
- metadata.gz: 9c79d9efb50c9fd98ee3dd0dcb9e68d0c33a2015c452c0bc7e5a0adb3487949beb324d5e90a312a812139f9cc28e6ce81ff5eb07a1fbb72c303306b3f0c5c433
7
- data.tar.gz: eb59bdcaeefb772e73503a3941bc383714301b221e5c41f94b68e68d4d17cb604f1ff56fb917992241aff8010ebf18c08961223b4426fdd1204260f3d3325c14
6
+ metadata.gz: c5abe583323af2e9bf05da0413d48cb0fe5e637fd71194a8b860a83f643a8676aa938f4099948a61c81edcc53959203a399e95aaf9fffa1de7a694f56ca0db0d
7
+ data.tar.gz: e65c0b5f048454d2551c534709c6f85be6b4dcb68534fffe1cf2c28708b894e9e54872c5447d7c8398c30cfaf83f4088497dbe213aa0a62bab0a56efa6e2ef6e
@@ -25,6 +25,19 @@ module Sinatra
25
25
  content_type :json
26
26
  REDIS.get("#{ENV['REDIS_KEY_PREFIX']}:last_updated")
27
27
  end
28
+
29
+ app.get '/internal/status' do
30
+ content_type :json
31
+ updated = REDIS.get("#{ENV['REDIS_KEY_PREFIX']}:last_updated")
32
+ last_updated = JSON.parse(updated)
33
+ updated_datetime = DateTime.parse(last_updated["last_updated"])
34
+ seconds_since_update = ((DateTime.now - updated_datetime) * 24 * 60 * 60).to_i
35
+ if seconds_since_update >= 300
36
+ status 503
37
+ end
38
+ "{}"
39
+ end
40
+
28
41
  end
29
42
 
30
43
  end
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: 1.6.3
4
+ version: 1.6.4
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: 2015-12-23 00:00:00.000000000 Z
11
+ date: 2016-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cfoundry