Skip to content

Commit 8c1c717

Browse files
committed
fix: 延迟启动
1 parent a6fb35b commit 8c1c717

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

telescope_provider.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"bytes"
55
"encoding/json"
66
"github.com/gin-gonic/gin"
7+
"github.com/go-home-admin/home/app"
78
uuid "github.com/satori/go.uuid"
89
"github.com/sirupsen/logrus"
910
"gorm.io/gorm"
@@ -24,8 +25,15 @@ type Providers struct {
2425
}
2526

2627
func (t *Providers) Init() {
27-
t.isOpen = true
28-
t.SetLog()
28+
if app.IsDebug() {
29+
t.isOpen = true
30+
}
31+
}
32+
33+
func (t *Providers) Boot() {
34+
if t.isOpen {
35+
t.SetLog()
36+
}
2937
}
3038

3139
func (t *Providers) IsEnable() bool {

0 commit comments

Comments
 (0)