fix: load env once

This commit is contained in:
lilong.129
2025-04-21 22:50:00 +08:00
parent 70a8ee01f7
commit 9418c651f4
3 changed files with 8 additions and 5 deletions
+3 -3
View File
@@ -30,12 +30,12 @@ type Config struct {
}
var (
globalConfig *Config
once sync.Once
globalConfig *Config
getConfigOnce sync.Once
)
func GetConfig() *Config {
once.Do(func() {
getConfigOnce.Do(func() {
cfg := &Config{
StartTime: time.Now(),
}