File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed
swarm/swarm-demo-frontend Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff line change 5
5
set :bind , '0.0.0.0'
6
6
set :port , 8080
7
7
8
- min_healthchecks = ENV [ 'MIN_REQUESTS_TILL_DEATH' ] || 10
9
- max_healthchecks = ENV [ 'MAX_REQUESTS_TILL_DEATH' ] || 25
10
-
11
8
AppState = { }
12
9
AppState [ :total_requests ] = 0
13
- AppState [ :total_healthchecks ] = 0
14
- AppState [ :healthchecks_till_death ] = rand ( max_healthchecks - max_healthchecks ) + min_healthchecks
15
10
16
11
get '/' do
17
12
AppState [ :total_requests ] += 1
28
23
end
29
24
30
25
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'
39
27
end
40
28
41
29
class RequestManager
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ version: "3.4"
2
2
3
3
services :
4
4
frontend :
5
- image : jfahrer/swarm-demo-frontend:v10
5
+ image : jfahrer/swarm-demo-frontend:v11
6
6
env_file :
7
7
- config/app.env
8
8
healthcheck :
You can’t perform that action at this time.
0 commit comments