🐛 Optimized launchpad

This commit is contained in:
2025-12-13 19:28:37 +08:00
parent 4d164ff7bf
commit d830c381d4
2 changed files with 15 additions and 10 deletions

View File

@@ -143,11 +143,15 @@ environment = [
volumes = ["./keys:/app/keys", "./settings/ring.json:/app/appsettings.json"] volumes = ["./keys:/app/keys", "./settings/ring.json:/app/appsettings.json"]
expose = ["${RING_PORT}", "${RING_ALTPORT}"] expose = ["${RING_PORT}", "${RING_ALTPORT}"]
networks = ["solar-network"] networks = ["solar-network"]
[services.prod.healthcheck]
test = ["CMD", "curl", "-f", "http://localhost:${RING_PORT}/health"]
interval = "10s"
timeout = "5s"
retries = 5
[services.prod.depends_on] [services.prod.depends_on]
cache = { condition = "service_healthy" } cache = { condition = "service_healthy" }
queue = { condition = "service_healthy" } queue = { condition = "service_healthy" }
[[services]] [[services]]
name = "pass" name = "pass"
type = "dotnet" type = "dotnet"
@@ -168,7 +172,7 @@ networks = ["solar-network"]
[services.prod.depends_on] [services.prod.depends_on]
cache = { condition = "service_healthy" } cache = { condition = "service_healthy" }
queue = { condition = "service_healthy" } queue = { condition = "service_healthy" }
ring = { condition = "service_healthy" }
[[services]] [[services]]
name = "sphere" name = "sphere"
@@ -190,7 +194,7 @@ networks = ["solar-network"]
[services.prod.depends_on] [services.prod.depends_on]
cache = { condition = "service_healthy" } cache = { condition = "service_healthy" }
queue = { condition = "service_healthy" } queue = { condition = "service_healthy" }
ring = { condition = "service_healthy" }
[[services]] [[services]]
name = "drive" name = "drive"
@@ -212,7 +216,7 @@ networks = ["solar-network"]
[services.prod.depends_on] [services.prod.depends_on]
cache = { condition = "service_healthy" } cache = { condition = "service_healthy" }
queue = { condition = "service_healthy" } queue = { condition = "service_healthy" }
ring = { condition = "service_healthy" }
[[services]] [[services]]
name = "develop" name = "develop"
@@ -234,7 +238,7 @@ networks = ["solar-network"]
[services.prod.depends_on] [services.prod.depends_on]
cache = { condition = "service_healthy" } cache = { condition = "service_healthy" }
queue = { condition = "service_healthy" } queue = { condition = "service_healthy" }
ring = { condition = "service_healthy" }
[[services]] [[services]]
name = "insight" name = "insight"
@@ -256,7 +260,7 @@ networks = ["solar-network"]
[services.prod.depends_on] [services.prod.depends_on]
cache = { condition = "service_healthy" } cache = { condition = "service_healthy" }
queue = { condition = "service_healthy" } queue = { condition = "service_healthy" }
ring = { condition = "service_healthy" }
[[services]] [[services]]
name = "zone" name = "zone"
@@ -278,3 +282,4 @@ networks = ["solar-network"]
[services.prod.depends_on] [services.prod.depends_on]
cache = { condition = "service_healthy" } cache = { condition = "service_healthy" }
queue = { condition = "service_healthy" } queue = { condition = "service_healthy" }
ring = { condition = "service_healthy" }

View File

@@ -65,7 +65,7 @@ func main() {
app := fiber.New(fiber.Config{ app := fiber.New(fiber.Config{
ServerHeader: "Turbine Gateway", ServerHeader: "Turbine Gateway",
BodyLimit: 2147483647, // 2GB BodyLimit: 2147483647,
}) })
// Health check and status // Health check and status
@@ -95,8 +95,8 @@ func main() {
app.Use(from, func(c fiber.Ctx) error { app.Use(from, func(c fiber.Ctx) error {
instance, err := serviceDiscovery.GetNextInstance(serviceName) instance, err := serviceDiscovery.GetNextInstance(serviceName)
if err != nil { if err != nil {
log.Error().Err(err).Str("service", serviceName).Msg("Failed to get service instance for override") log.Info().Err(err).Str("service", serviceName).Msg("No service found")
return c.Status(fiber.StatusServiceUnavailable).SendString(err.Error()) return fiber.ErrNotFound
} }
targetURL := fmt.Sprintf("http://%s/%s", instance, remainingPath) targetURL := fmt.Sprintf("http://%s/%s", instance, remainingPath)
@@ -138,7 +138,7 @@ func main() {
return c.Status(fiber.StatusServiceUnavailable).SendString(err.Error()) return c.Status(fiber.StatusServiceUnavailable).SendString(err.Error())
} }
targetURL := fmt.Sprintf("http://%s/%s", instance, remainingPath) targetURL := fmt.Sprintf("http://%s/api/%s", instance, remainingPath)
if len(c.Request().URI().QueryString()) > 0 { if len(c.Request().URI().QueryString()) > 0 {
targetURL = fmt.Sprintf("%s?%s", targetURL, string(c.Request().URI().QueryString())) targetURL = fmt.Sprintf("%s?%s", targetURL, string(c.Request().URI().QueryString()))
} }