mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
allow to customize timeout and env vars for program based hooks
Fixes #847 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -141,12 +141,6 @@ func (s *Service) Start(disableAWSInstallationCode bool) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = s.LoadInitialData()
|
||||
if err != nil {
|
||||
logger.Error(logSender, "", "unable to load initial data: %v", err)
|
||||
logger.ErrorToConsole("unable to load initial data: %v", err)
|
||||
}
|
||||
|
||||
httpConfig := config.GetHTTPConfig()
|
||||
err = httpConfig.Initialize(s.ConfigDir)
|
||||
if err != nil {
|
||||
@@ -154,6 +148,12 @@ func (s *Service) Start(disableAWSInstallationCode bool) error {
|
||||
logger.ErrorToConsole("error initializing http client: %v", err)
|
||||
return err
|
||||
}
|
||||
commandConfig := config.GetCommandConfig()
|
||||
if err := commandConfig.Initialize(); err != nil {
|
||||
logger.Error(logSender, "", "error initializing commands configuration: %v", err)
|
||||
logger.ErrorToConsole("error initializing commands configuration: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
s.startServices()
|
||||
go common.Config.ExecuteStartupHook() //nolint:errcheck
|
||||
@@ -162,6 +162,12 @@ func (s *Service) Start(disableAWSInstallationCode bool) error {
|
||||
}
|
||||
|
||||
func (s *Service) startServices() {
|
||||
err := s.LoadInitialData()
|
||||
if err != nil {
|
||||
logger.Error(logSender, "", "unable to load initial data: %v", err)
|
||||
logger.ErrorToConsole("unable to load initial data: %v", err)
|
||||
}
|
||||
|
||||
sftpdConf := config.GetSFTPDConfig()
|
||||
ftpdConf := config.GetFTPDConfig()
|
||||
httpdConf := config.GetHTTPDConfig()
|
||||
|
||||
Reference in New Issue
Block a user