diff --git a/cmd/server.go b/cmd/server.go index 2eca6074..20850f50 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -28,6 +28,10 @@ var ServerCmd = &cobra.Command{ the address is defined in config file`, Run: func(cmd *cobra.Command, args []string) { Init() + if conf.Conf.DelayedStart != 0 { + utils.Log.Infof("delayed start for %d seconds", conf.Conf.DelayedStart) + time.Sleep(time.Duration(conf.Conf.DelayedStart) * time.Second) + } bootstrap.InitAria2() bootstrap.InitQbittorrent() bootstrap.LoadStorages() diff --git a/internal/conf/config.go b/internal/conf/config.go index 3c027bdc..57e14a2a 100644 --- a/internal/conf/config.go +++ b/internal/conf/config.go @@ -47,6 +47,7 @@ type Config struct { TempDir string `json:"temp_dir" env:"TEMP_DIR"` BleveDir string `json:"bleve_dir" env:"BLEVE_DIR"` Log LogConfig `json:"log"` + DelayedStart int `json:"delayed_start" env:"DELAYED_START"` MaxConnections int `json:"max_connections" env:"MAX_CONNECTIONS"` TlsInsecureSkipVerify bool `json:"tls_insecure_skip_verify" env:"TLS_INSECURE_SKIP_VERIFY"` }