Skip to content

Commit 1795f09

Browse files
committed
Change the manipulated status endpoint so that it just returns 'ok'
[refs %ed348cc55dc4]
1 parent 6bde50c commit 1795f09

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

swarm/swarm-demo-frontend/app.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@
55
set :bind, '0.0.0.0'
66
set :port, 8080
77

8-
min_healthchecks = ENV['MIN_REQUESTS_TILL_DEATH'] || 10
9-
max_healthchecks = ENV['MAX_REQUESTS_TILL_DEATH'] || 25
10-
118
AppState = {}
129
AppState[:total_requests] = 0
13-
AppState[:total_healthchecks] = 0
14-
AppState[:healthchecks_till_death] = rand(max_healthchecks - max_healthchecks) + min_healthchecks
1510

1611
get '/' do
1712
AppState[:total_requests] += 1
@@ -28,14 +23,7 @@
2823
end
2924

3025
get '/status' do
31-
AppState[:total_healthchecks] += 1
32-
if AppState[:total_healthchecks] >= AppState[:healthchecks_till_death]
33-
status 500
34-
'failure'
35-
else
36-
status 200
37-
'ok'
38-
end
26+
'ok'
3927
end
4028

4129
class RequestManager

swarm/swarm-demo-frontend/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.4"
22

33
services:
44
frontend:
5-
image: jfahrer/swarm-demo-frontend:v10
5+
image: jfahrer/swarm-demo-frontend:v11
66
env_file:
77
- config/app.env
88
healthcheck:

0 commit comments

Comments
 (0)