conf singleton issue
This commit is contained in:
@@ -124,6 +124,7 @@ func GetLogger() zerolog.Logger {
|
||||
* @return *Config
|
||||
*/
|
||||
func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string, logLevel string) *config.Config {
|
||||
cfg := config.SetConfig(mongoUrl, database, natsUrl, lokiUrl, logLevel)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
tools.UncatchedError = append(tools.UncatchedError, errors.New("Panic recovered in Init : "+fmt.Sprintf("%v", r)+" - "+string(debug.Stack())))
|
||||
@@ -131,7 +132,6 @@ func SetConfig(mongoUrl string, database string, natsUrl string, lokiUrl string,
|
||||
}
|
||||
}()
|
||||
logs.CreateLogger("main")
|
||||
cfg := config.SetConfig(mongoUrl, database, natsUrl, lokiUrl, logLevel)
|
||||
mongo.MONGOService.Init(models.GetModelsNames(), config.GetConfig()) // init the mongo service
|
||||
/*
|
||||
Here we will check if the resource model is already stored in the database
|
||||
|
||||
Reference in New Issue
Block a user