mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
initial data loading: an error is no longer fatal
therefore it does not prevent the services from starting
This commit is contained in:
parent
70bde8b2bc
commit
6699f5c2cc
3 changed files with 4 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue