add goSec, go-lint, update actions (#2)
All checks were successful
Gitea Docker Build Demo / Test (push) Successful in 3m20s
Gitea Docker Build Demo / Build_Image (push) Successful in 1m25s

Co-authored-by: Julian <j-ha+gitea@uploadfilter24.eu>
Co-committed-by: Julian <j-ha+gitea@uploadfilter24.eu>
This commit is contained in:
2025-10-09 15:47:40 +00:00
committed by lerentis
parent 4805faf9db
commit 4aa8d104bb
5 changed files with 53 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"net/http"
"sync"
"time"
"github.com/gorilla/mux"
log "github.com/sirupsen/logrus"
@@ -36,7 +37,16 @@ func (hs *HealthServer) Start() {
r := mux.NewRouter()
r.Use(mux.CORSMethodMiddleware(r))
r.HandleFunc("/health", hs.sendHealth).Methods(http.MethodGet)
err := http.ListenAndServe("0.0.0.0:8080", r)
server := &http.Server{
Addr: "0.0.0.0:8080",
Handler: r,
ReadTimeout: 15 * time.Second,
WriteTimeout: 15 * time.Second,
IdleTimeout: 60 * time.Second,
}
err := server.ListenAndServe()
if err != nil {
log.WithFields(log.Fields{
"Caller": "HealthServer.Start",