feat: support delayed start (#4532)
This commit is contained in:
parent
1e62666406
commit
f9e067abec
@ -28,6 +28,10 @@ var ServerCmd = &cobra.Command{
|
|||||||
the address is defined in config file`,
|
the address is defined in config file`,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
Init()
|
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.InitAria2()
|
||||||
bootstrap.InitQbittorrent()
|
bootstrap.InitQbittorrent()
|
||||||
bootstrap.LoadStorages()
|
bootstrap.LoadStorages()
|
||||||
|
@ -47,6 +47,7 @@ type Config struct {
|
|||||||
TempDir string `json:"temp_dir" env:"TEMP_DIR"`
|
TempDir string `json:"temp_dir" env:"TEMP_DIR"`
|
||||||
BleveDir string `json:"bleve_dir" env:"BLEVE_DIR"`
|
BleveDir string `json:"bleve_dir" env:"BLEVE_DIR"`
|
||||||
Log LogConfig `json:"log"`
|
Log LogConfig `json:"log"`
|
||||||
|
DelayedStart int `json:"delayed_start" env:"DELAYED_START"`
|
||||||
MaxConnections int `json:"max_connections" env:"MAX_CONNECTIONS"`
|
MaxConnections int `json:"max_connections" env:"MAX_CONNECTIONS"`
|
||||||
TlsInsecureSkipVerify bool `json:"tls_insecure_skip_verify" env:"TLS_INSECURE_SKIP_VERIFY"`
|
TlsInsecureSkipVerify bool `json:"tls_insecure_skip_verify" env:"TLS_INSECURE_SKIP_VERIFY"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user