conf singleton issue
This commit is contained in:
@@ -37,7 +37,7 @@ func GetConfig() *Config {
|
||||
}
|
||||
|
||||
func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string, logLevel string) *Config {
|
||||
once.Do(func() {
|
||||
/*once.Do(func() {
|
||||
instance = &Config{
|
||||
MongoUrl: mongoUrl,
|
||||
MongoDatabase: database,
|
||||
@@ -45,6 +45,11 @@ func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string,
|
||||
LokiUrl: lokiUrl,
|
||||
LogLevel: logLevel,
|
||||
}
|
||||
})
|
||||
return instance
|
||||
})*/
|
||||
GetConfig().MongoUrl = mongoUrl
|
||||
GetConfig().MongoDatabase = database
|
||||
GetConfig().NATSUrl = natsUrl
|
||||
GetConfig().LokiUrl = lokiUrl
|
||||
GetConfig().LogLevel = logLevel
|
||||
return GetConfig()
|
||||
}
|
||||
|
Reference in New Issue
Block a user