mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
feat: 优化 GeoIP 更新逻辑
This commit is contained in:
@@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"embed"
|
||||
_ "embed"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
@@ -130,8 +129,6 @@ func main() {
|
||||
http2Server := &http2.Server{}
|
||||
muxServer := &http.Server{Handler: h2c.NewHandler(muxHandler, http2Server), ReadHeaderTimeout: time.Second * 5}
|
||||
|
||||
go dispatchReportInfoTask()
|
||||
|
||||
if err := graceful.Graceful(func() error {
|
||||
log.Printf("NEZHA>> Dashboard::START ON %s:%d", singleton.Conf.ListenHost, singleton.Conf.ListenPort)
|
||||
return muxServer.Serve(l)
|
||||
@@ -145,21 +142,6 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func dispatchReportInfoTask() {
|
||||
time.Sleep(time.Second * 15)
|
||||
singleton.ServerLock.RLock()
|
||||
defer singleton.ServerLock.RUnlock()
|
||||
for _, server := range singleton.ServerList {
|
||||
if server == nil || server.TaskStream == nil {
|
||||
continue
|
||||
}
|
||||
server.TaskStream.Send(&proto.Task{
|
||||
Type: model.TaskTypeReportHostInfo,
|
||||
Data: "",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func newHTTPandGRPCMux(httpHandler http.Handler, grpcHandler http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
natConfig := singleton.GetNATConfigByDomain(r.Host)
|
||||
|
||||
Reference in New Issue
Block a user