initial data loading: an error is no longer fatal

therefore it does not prevent the services from starting
This commit is contained in:
Nicola Murino 2020-11-25 09:18:36 +01:00
parent 70bde8b2bc
commit 6699f5c2cc
No known key found for this signature in database
GPG key ID: 2F1FB59433D5A8CB
3 changed files with 4 additions and 5 deletions

View file

@ -764,7 +764,7 @@ func createProvider(basePath string) error {
} else if config.Driver == BoltDataProviderName {
err = initializeBoltProvider(basePath)
} else if config.Driver == MemoryDataProviderName {
err = initializeMemoryProvider(basePath)
initializeMemoryProvider(basePath)
} else {
err = fmt.Errorf("unsupported data provider: %v", config.Driver)
}

View file

@ -41,7 +41,7 @@ type MemoryProvider struct {
dbHandle *memoryProviderHandle
}
func initializeMemoryProvider(basePath string) error {
func initializeMemoryProvider(basePath string) {
logSender = fmt.Sprintf("dataprovider_%v", MemoryDataProviderName)
configFile := ""
if utils.IsFileInputValid(config.Name) {
@ -62,9 +62,9 @@ func initializeMemoryProvider(basePath string) error {
},
}
if err := provider.reloadConfig(); err != nil {
logger.Error(logSender, "", "unable to load initial data: %v", err)
logger.ErrorToConsole("unable to load initial data: %v", err)
}
return nil
}
func (p MemoryProvider) checkAvailability() error {
@ -604,7 +604,7 @@ func (p MemoryProvider) clear() {
}
func (p MemoryProvider) reloadConfig() error {
if len(p.dbHandle.configFile) == 0 {
if p.dbHandle.configFile == "" {
providerLog(logger.LevelDebug, "no users configuration file defined")
return nil
}

View file

@ -105,7 +105,6 @@ func (s *Service) Start() error {
if err != nil {
logger.Error(logSender, "", "unable to load initial data: %v", err)
logger.ErrorToConsole("unable to load initial data: %v", err)
return err
}
httpConfig := config.GetHTTPConfig()