mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 20:52:33 +02:00
chore: cont fa16f415
This commit is contained in:
parent
eb7495b02a
commit
dc1102905b
4 changed files with 7 additions and 3 deletions
|
@ -125,7 +125,7 @@ func (cfg *AgentConfig) InitWithCerts(ctx context.Context, ca, crt, key []byte)
|
||||||
|
|
||||||
versionStr := string(version)
|
versionStr := string(version)
|
||||||
// skip version check for dev versions
|
// skip version check for dev versions
|
||||||
if strings.HasPrefix(versionStr, "v") && !checkVersion(versionStr, pkg.GetVersion()) {
|
if strings.HasPrefix(versionStr, "v") && !checkVersion(versionStr, pkg.GetVersion().String()) {
|
||||||
return gperr.Errorf("agent version mismatch: server: %s, agent: %s", pkg.GetVersion(), versionStr)
|
return gperr.Errorf("agent version mismatch: server: %s, agent: %s", pkg.GetVersion(), versionStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"github.com/yusing/go-proxy/internal/net/gphttp/middleware"
|
"github.com/yusing/go-proxy/internal/net/gphttp/middleware"
|
||||||
"github.com/yusing/go-proxy/internal/route/routes/routequery"
|
"github.com/yusing/go-proxy/internal/route/routes/routequery"
|
||||||
"github.com/yusing/go-proxy/internal/task"
|
"github.com/yusing/go-proxy/internal/task"
|
||||||
|
"github.com/yusing/go-proxy/migrations"
|
||||||
"github.com/yusing/go-proxy/pkg"
|
"github.com/yusing/go-proxy/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -39,6 +40,9 @@ func parallel(fns ...func()) {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
initProfiling()
|
initProfiling()
|
||||||
|
if err := migrations.RunMigrations(); err != nil {
|
||||||
|
gperr.LogFatal("migration error", err)
|
||||||
|
}
|
||||||
args := pkg.GetArgs(common.MainServerCommandValidator{})
|
args := pkg.GetArgs(common.MainServerCommandValidator{})
|
||||||
|
|
||||||
switch args.Command {
|
switch args.Command {
|
||||||
|
|
|
@ -8,5 +8,5 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetVersion(w http.ResponseWriter, r *http.Request) {
|
func GetVersion(w http.ResponseWriter, r *http.Request) {
|
||||||
gphttp.WriteBody(w, []byte(pkg.GetVersion()))
|
gphttp.WriteBody(w, []byte(pkg.GetVersion().String()))
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ func (mon *HTTPHealthMonitor) CheckHealth() (result *health.HealthCheckResult, e
|
||||||
}
|
}
|
||||||
req.Close = true
|
req.Close = true
|
||||||
req.Header.Set("Connection", "close")
|
req.Header.Set("Connection", "close")
|
||||||
req.Header.Set("User-Agent", "GoDoxy/"+pkg.GetVersion())
|
req.Header.Set("User-Agent", "GoDoxy/"+pkg.GetVersion().String())
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
resp, respErr := pinger.Do(req)
|
resp, respErr := pinger.Do(req)
|
||||||
|
|
Loading…
Add table
Reference in a new issue