Skip to content

Commit 410a42a

Browse files
committed
changes
1 parent 1b71ff5 commit 410a42a

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

backend/pycon/wsgi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import signal
23
import os
34

@@ -10,6 +11,8 @@ def handle_sigterm(signum, frame):
1011
with open("shutdown", "w") as f:
1112
f.write("shutdown")
1213

14+
sys.exit(0)
15+
1316

1417
try:
1518
signal.signal(signal.SIGTERM, handle_sigterm)

frontend/src/instrumentation.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ export async function register() {
66
const fs = await import("fs");
77

88
process.on("SIGTERM", () => {
9+
console.log("Received SIGTERM, starting graceful shutdown");
10+
911
fs.writeFileSync("/tmp/shutdown", "1");
12+
13+
setTimeout(() => {
14+
process.exit(0);
15+
}, 20 * 1000); // 20 secs shutdown timeout
1016
});
1117
}
1218
}

infrastructure/applications/cluster/load_balancer_task.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ resource "aws_ecs_task_definition" "traefik" {
3535
},
3636
{
3737
name = "TRAEFIK_PROVIDERS_ECS_REFRESHSECONDS",
38-
value = "10"
38+
value = "15"
3939
},
4040
{
4141
name = "TRAEFIK_LOG_LEVEL"

infrastructure/applications/pretix/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ resource "aws_ecs_task_definition" "pretix" {
2525
retries = 3
2626
command = [
2727
"CMD-SHELL",
28-
"curl --header 'Host: ${local.alias}' -f http://127.0.0.1/healthcheck/ || exit 1"
28+
"curl -s --header 'Host: ${local.alias}' -f http://127.0.0.1/healthcheck/ || exit 1"
2929
]
3030
timeout = 3
3131
interval = 10

infrastructure/applications/pycon_frontend/task.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ resource "aws_ecs_task_definition" "pycon_frontend" {
7575
retries = 3
7676
command = [
7777
"CMD-SHELL",
78-
"curl -f http://localhost:3000/api/health || exit 1"
78+
"curl -s -f http://localhost:3000/api/health || exit 1"
7979
]
80-
timeout = 3
80+
timeout = 5
8181
interval = 10
8282
}
8383

0 commit comments

Comments
 (0)