Добавить X-Instance-Id, задержку drain при SIGTERM и отдельный запуск миграций

This commit is contained in:
2026-11-02 16:58:11 +03:00
parent 5b9f377783
commit 7fa8881eb3
21 changed files with 389 additions and 64 deletions
+9
View File
@@ -13,6 +13,15 @@ import (
"github.com/gin-gonic/gin"
)
// instance names the process that answered, so a client behind the load
// balancer can tell the replicas apart.
func instance(id string) gin.HandlerFunc {
return func(c *gin.Context) {
c.Writer.Header().Set("X-Instance-Id", id)
c.Next()
}
}
// requestID assigns a fresh identifier to every request.
//
// An incoming X-Request-Id is deliberately not reused. This service is