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