mirror of
https://github.com/drakkan/sftpgo.git
synced 2026-03-14 14:25:52 +01:00
initprovider cmd: initialize enabled commands before loading initial data
Fixes #2166 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
86e511d74b
commit
93e23e6f27
1 changed files with 5 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/drakkan/sftpgo/v2/internal/common"
|
||||
"github.com/drakkan/sftpgo/v2/internal/config"
|
||||
"github.com/drakkan/sftpgo/v2/internal/dataprovider"
|
||||
"github.com/drakkan/sftpgo/v2/internal/logger"
|
||||
|
|
@ -98,6 +99,10 @@ Please take a look at the usage below to customize the options.`,
|
|||
os.Exit(1)
|
||||
}
|
||||
if providerConf.Driver != dataprovider.MemoryDataProviderName && loadDataFrom != "" {
|
||||
if err := common.Initialize(config.GetCommonConfig(), providerConf.GetShared()); err != nil {
|
||||
logger.ErrorToConsole("%v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
service := service.Service{
|
||||
LoadDataFrom: loadDataFrom,
|
||||
LoadDataMode: loadDataMode,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue