feat: restart to apply update, privileged helper, rollback

This commit is contained in:
fsylvain committed 2026-10-01 21:36:40 +02:00
1 parent 70460e4170
commit 54e8fd5fed
63 files changed
+8635 -164

No files matched your search

@@ -0,0 +1,32 @@
package update
import (
domain "RenewCMS/internal/domain/update"
"net/http"
"time"
)
const healthCheckTimeout = 2 * time.Second
type HTTPHealthChecker struct {
url string
client *http.Client
}
var _ domain.HealthChecker = &HTTPHealthChecker{}
func NewHTTPHealthChecker(port string) *HTTPHealthChecker {
return &HTTPHealthChecker{
url: "http://127.0.0.1:" + port + "/healthz",
client: &http.Client{Timeout: healthCheckTimeout},
}
}
func (c *HTTPHealthChecker) Healthy() bool {
response, err := c.client.Get(c.url)
if err != nil {
return false
}
defer response.Body.Close()
return response.StatusCode == http.StatusOK
}