mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 17:25:52 +00:00
Enable some linters (#3129)
Mostly those that did not require much work. From #2960 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -271,6 +271,8 @@ func getBackendEngine(backendCtx context.Context, backendName string, addons []s
|
||||
}
|
||||
|
||||
func runWithRetry(context *cli.Context) error {
|
||||
initHealth()
|
||||
|
||||
retryCount := context.Int("connect-retry-count")
|
||||
retryDelay := context.Duration("connect-retry-delay")
|
||||
var err error
|
||||
|
@@ -31,7 +31,7 @@ import (
|
||||
// following specification:
|
||||
// https://github.com/mozilla-services/Dockerflow
|
||||
|
||||
func init() {
|
||||
func initHealth() {
|
||||
http.HandleFunc("/varz", handleStats)
|
||||
http.HandleFunc("/healthz", handleHeartbeat)
|
||||
http.HandleFunc("/version", handleVersion)
|
||||
@@ -48,10 +48,13 @@ func handleHeartbeat(w http.ResponseWriter, _ *http.Request) {
|
||||
func handleVersion(w http.ResponseWriter, _ *http.Request) {
|
||||
w.WriteHeader(200)
|
||||
w.Header().Add("Content-Type", "text/json")
|
||||
_ = json.NewEncoder(w).Encode(versionResp{
|
||||
err := json.NewEncoder(w).Encode(versionResp{
|
||||
Source: "https://github.com/woodpecker-ci/woodpecker",
|
||||
Version: version.String(),
|
||||
})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("handleVersion")
|
||||
}
|
||||
}
|
||||
|
||||
func handleStats(w http.ResponseWriter, _ *http.Request) {
|
||||
|
Reference in New Issue
Block a user