Skip to content

Commit

Permalink
feat✨: Log file size control and retention days control
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjianzhang committed Nov 3, 2023
1 parent 7281d05 commit d366df3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions cmd/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api
import (
"context"
"fmt"
"github.com/go-admin-team/go-admin-core/sdk/runtime"
"github.com/pkg/errors"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -100,7 +100,7 @@ func run() error {
if apiCheck {
var routers = sdk.Runtime.GetRouter()
q := sdk.Runtime.GetMemoryQueue("")
mp := make(map[string]interface{}, 0)
mp := make(map[string]interface{})
mp["List"] = routers
message, err := sdk.Runtime.GetStreamMessage("", global.ApiCheck, mp)
if err != nil {
Expand All @@ -117,11 +117,11 @@ func run() error {
go func() {
// 服务连接
if config.SslConfig.Enable {
if err := srv.ListenAndServeTLS(config.SslConfig.Pem, config.SslConfig.KeyStr); err != nil && err != http.ErrServerClosed {
if err := srv.ListenAndServeTLS(config.SslConfig.Pem, config.SslConfig.KeyStr); err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatal("listen: ", err)
}
} else {
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
if err := srv.ListenAndServe(); err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatal("listen: ", err)
}
}
Expand Down Expand Up @@ -152,7 +152,7 @@ func run() error {
return nil
}

var Router runtime.Router
//var Router runtime.Router

func tip() {
usageStr := `欢迎使用 ` + pkg.Green(`go-admin `+global.Version) + ` 可以使用 ` + pkg.Red(`-h`) + ` 查看命令`
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ require (
github.com/bytedance/go-tagexpr/v2 v2.9.11
github.com/casbin/casbin/v2 v2.77.2
github.com/gin-gonic/gin v1.9.1
github.com/go-admin-team/go-admin-core v1.5.2-0.20231103084818-110915f53e70
github.com/go-admin-team/go-admin-core/sdk v1.5.2-0.20231103090141-8c06ea121672
github.com/go-admin-team/go-admin-core v1.5.2-0.20231103105356-84418ed9252c
github.com/go-admin-team/go-admin-core/sdk v1.5.2-0.20231103105356-84418ed9252c
github.com/google/uuid v1.4.0
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.9+incompatible
github.com/mssola/user_agent v0.6.0
Expand Down Expand Up @@ -66,7 +66,7 @@ require (
github.com/ghodss/yaml v1.0.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/git-chglog/git-chglog v0.15.4 // indirect
github.com/go-admin-team/go-admin-core/plugins/logger/zap v1.3.5-rc.0.0.20231103084621-a186c68d83c2 // indirect
github.com/go-admin-team/go-admin-core/plugins/logger/zap v1.3.5-rc.0.0.20231103105142-2d9e40ec6f71 // indirect
github.com/go-admin-team/gorm-adapter/v3 v3.7.8-0.20220809100335-eaf9f67b3d21 // indirect
github.com/go-admin-team/redis-watcher/v2 v2.0.0-20231102130416-bfe327cac940 // indirect
github.com/go-admin-team/redisqueue/v2 v2.0.1-0.20231102124201-508101cc789a // indirect
Expand Down

0 comments on commit d366df3

Please sign in to comment.