File tree Expand file tree Collapse file tree 4 files changed +30
-2
lines changed
infrastructure/applications/cluster Expand file tree Collapse file tree 4 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 1+ import os
12from django .conf import settings
23from django .http import JsonResponse
34from users .models import User
45
56
67def healthcheck (request ):
8+ if os .path .exists ("shutdown" ):
9+ return JsonResponse (
10+ {
11+ "status" : "shutdown" ,
12+ "version" : settings .GITHASH ,
13+ },
14+ status = 503 ,
15+ )
16+
717 User .objects .exists ()
818
919 return JsonResponse (
Original file line number Diff line number Diff line change 384384
385385IS_RUNNING_TESTS = False
386386
387- ECS_NETWORK_CONFIG = json .loads (env ("ECS_NETWORK_CONFIG" , default = "{}" ))
387+ try :
388+ ECS_NETWORK_CONFIG = json .loads (env ("ECS_NETWORK_CONFIG" , default = "" ))
389+ except json .decoder .JSONDecodeError :
390+ ECS_NETWORK_CONFIG = {}
391+
388392ECS_SERVICE_ROLE = env ("ECS_SERVICE_ROLE" , default = "" )
389393
390394SNS_WEBHOOK_SECRET = env ("SNS_WEBHOOK_SECRET" , default = "" )
Original file line number Diff line number Diff line change 1+ import signal
12import os
23
34from django .core .wsgi import get_wsgi_application
45
56os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "pycon.settings.prod" )
67
8+
9+ def handle_sigterm (signum , frame ):
10+ print ("PyCon Received SIGTERM" )
11+ with open ("shutdown" , "w" ) as f :
12+ f .write ("shutdown" )
13+
14+
15+ try :
16+ signal .signal (signal .SIGTERM , handle_sigterm )
17+ except ValueError :
18+ print ("Could not set signal handler" )
19+
20+
721application = get_wsgi_application ()
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ resource "aws_ecs_task_definition" "traefik" {
5252
5353 dockerLabels = {
5454 " traefik.enable" = " true"
55- " traefik.http.middlewares.retry.retry.attempts" = " 2 "
55+ " traefik.http.middlewares.retry.retry.attempts" = " 4 "
5656 " traefik.http.middlewares.retry.retry.initialInterval" = " 100ms"
5757 }
5858
You can’t perform that action at this time.
0 commit comments