initprovider: check if the provider is already initialized

exit with code 0 if no initialization is required
This commit is contained in:
Nicola Murino
2020-08-30 13:50:43 +02:00
parent 2746c0b0f1
commit 600a107699
9 changed files with 22 additions and 15 deletions

View File

@@ -46,6 +46,8 @@ Please take a look at the usage below to customize the options.`,
err = dataprovider.InitializeDatabase(providerConf, configDir)
if err == nil {
logger.DebugToConsole("Data provider successfully initialized")
} else if err == dataprovider.ErrNoInitRequired {
logger.DebugToConsole("%v", err.Error())
} else {
logger.WarnToConsole("Unable to initialize data provider: %v", err)
os.Exit(1)