feat 修改慢sql时间
Some checks failed
Build image / build (push) Failing after 4m24s

This commit is contained in:
timerzz 2024-05-30 21:41:05 +08:00
parent ea3777437f
commit fee3f675d5
3 changed files with 12 additions and 2 deletions

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.22.2
toolchain go1.22.3 toolchain go1.22.3
require ( require (
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240521073651-0653521e73ea gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240530133209-38f473928f02
gitea.timerzz.com/kedaya_haitao/pusher v0.0.0-20240521124219-55c7fe31e0e1 gitea.timerzz.com/kedaya_haitao/pusher v0.0.0-20240521124219-55c7fe31e0e1
github.com/gofiber/fiber/v3 v3.0.0-beta.2 github.com/gofiber/fiber/v3 v3.0.0-beta.2
github.com/golang/glog v1.2.1 github.com/golang/glog v1.2.1

2
go.sum
View File

@ -4,6 +4,8 @@ gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zum
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240521073651-0653521e73ea h1:asjEGs0rxu+pMXEd6bWipoingfhLBG1qP3Gt6lSy2Kg= gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240521073651-0653521e73ea h1:asjEGs0rxu+pMXEd6bWipoingfhLBG1qP3Gt6lSy2Kg=
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240521073651-0653521e73ea/go.mod h1:cgLy4gB0z2UZD3kBp1IAemt28dkaKNdt4RC0LNkE1I8= gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240521073651-0653521e73ea/go.mod h1:cgLy4gB0z2UZD3kBp1IAemt28dkaKNdt4RC0LNkE1I8=
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240530133209-38f473928f02 h1:bjpd9t8dSCmH488m6qnzSWWj9a/Gih0m1gIqjVuF1hk=
gitea.timerzz.com/kedaya_haitao/common v0.0.0-20240530133209-38f473928f02/go.mod h1:cgLy4gB0z2UZD3kBp1IAemt28dkaKNdt4RC0LNkE1I8=
gitea.timerzz.com/kedaya_haitao/pusher v0.0.0-20240521124219-55c7fe31e0e1 h1:OyFVnuMB4LaYNnxSizu/uWmHa1lF4BetAilV8xn6QX4= gitea.timerzz.com/kedaya_haitao/pusher v0.0.0-20240521124219-55c7fe31e0e1 h1:OyFVnuMB4LaYNnxSizu/uWmHa1lF4BetAilV8xn6QX4=
gitea.timerzz.com/kedaya_haitao/pusher v0.0.0-20240521124219-55c7fe31e0e1/go.mod h1:4N9xAFCbyuoyNVvJpwZ64UlnRlJ7AMQeJfTNLJZYoto= gitea.timerzz.com/kedaya_haitao/pusher v0.0.0-20240521124219-55c7fe31e0e1/go.mod h1:4N9xAFCbyuoyNVvJpwZ64UlnRlJ7AMQeJfTNLJZYoto=
github.com/3andne/restls-client-go v0.1.6 h1:tRx/YilqW7iHpgmEL4E1D8dAsuB0tFF3uvncS+B6I08= github.com/3andne/restls-client-go v0.1.6 h1:tRx/YilqW7iHpgmEL4E1D8dAsuB0tFF3uvncS+B6I08=

View File

@ -9,12 +9,15 @@ import (
"github.com/gofiber/fiber/v3" "github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v3/middleware/cors" "github.com/gofiber/fiber/v3/middleware/cors"
"github.com/golang/glog" "github.com/golang/glog"
"gorm.io/gorm/logger"
"haitao_watcher/pkg/options" "haitao_watcher/pkg/options"
"haitao_watcher/pkg/watcher" "haitao_watcher/pkg/watcher"
"haitao_watcher/server" "haitao_watcher/server"
"log"
"log/slog" "log/slog"
"os" "os"
"os/signal" "os/signal"
"time"
) )
func main() { func main() {
@ -29,7 +32,12 @@ func main() {
if err != nil { if err != nil {
glog.Fatalf("初始化数据库失败:%v", err) glog.Fatalf("初始化数据库失败:%v", err)
} }
db.Logger = logger.New(log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{
SlowThreshold: time.Second,
LogLevel: logger.Warn,
IgnoreRecordNotFoundError: false,
Colorful: true,
})
pool := proxy.NewProxyPool(cfg.Proxy.Subscribes) pool := proxy.NewProxyPool(cfg.Proxy.Subscribes)
go pool.CronUpdate(ctx, cfg.Proxy.Interval) //定时更新代理 go pool.CronUpdate(ctx, cfg.Proxy.Interval) //定时更新代理