set addr in admin
This commit is contained in:
parent
ca3d8177bd
commit
f6fdd83a23
6
admin.go
6
admin.go
@ -56,6 +56,10 @@ func (a *AdminConfig) Run() {
|
|||||||
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
||||||
defer stop()
|
defer stop()
|
||||||
|
|
||||||
|
if !*debug {
|
||||||
|
gin.SetMode(gin.ReleaseMode)
|
||||||
|
}
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
r.GET("/ping", func(c *gin.Context) {
|
r.GET("/ping", func(c *gin.Context) {
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
@ -64,7 +68,7 @@ func (a *AdminConfig) Run() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Addr: ":8080",
|
Addr: a.Addr,
|
||||||
Handler: r,
|
Handler: r,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
@ -41,10 +40,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
log.SetReportCaller(true)
|
log.SetReportCaller(true)
|
||||||
|
|
||||||
email = new(Email)
|
|
||||||
email.startTime = time.Now()
|
|
||||||
email.items = make([]string, 0)
|
|
||||||
|
|
||||||
if err := cfg.LoadFile(*cfgFile); err != nil {
|
if err := cfg.LoadFile(*cfgFile); err != nil {
|
||||||
log.Printf("Cannot load config (%s)", err)
|
log.Printf("Cannot load config (%s)", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||||
package main
|
package main
|
||||||
var githash = "da53fcf"
|
var githash = "ca3d817"
|
||||||
var branch = "v2"
|
var branch = "v2"
|
||||||
var buildstamp = "2023-07-31_09:23:23"
|
var buildstamp = "2023-07-31_16:19:11"
|
||||||
var commits = "73"
|
var commits = "75"
|
||||||
var version = "da53fcf-b73 - 2023-07-31_09:23:23"
|
var version = "ca3d817-b75 - 2023-07-31_16:19:11"
|
||||||
|
Loading…
Reference in New Issue
Block a user