mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-16 19:35:14 +00:00
Make healthcheck port configurable (#1197)
Closes https://github.com/woodpecker-ci/woodpecker/issues/1193 Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
1d47da647b
commit
d28080a9eb
2 changed files with 8 additions and 1 deletions
|
@ -17,6 +17,7 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"runtime"
|
||||
|
@ -89,7 +90,7 @@ func loop(c *cli.Context) error {
|
|||
|
||||
if c.Bool("healthcheck") {
|
||||
go func() {
|
||||
if err := http.ListenAndServe(":3000", nil); err != nil {
|
||||
if err := http.ListenAndServe(fmt.Sprintf(":%d", c.Int("healthcheck-port")), nil); err != nil {
|
||||
log.Error().Msgf("can not listen on port 3000: %v", err)
|
||||
}
|
||||
}()
|
||||
|
|
|
@ -89,6 +89,12 @@ var flags = []cli.Flag{
|
|||
Usage: "enable healthcheck endpoint",
|
||||
Value: true,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
EnvVars: []string{"WOODPECKER_HEALTHCHECK_PORT"},
|
||||
Name: "healthcheck-port",
|
||||
Usage: "port used for healthcheck endpoint",
|
||||
Value: 3000,
|
||||
},
|
||||
&cli.DurationFlag{
|
||||
EnvVars: []string{"WOODPECKER_KEEPALIVE_TIME"},
|
||||
Name: "keepalive-time",
|
||||
|
|
Loading…
Reference in a new issue