fix: add process timeout option default_process_timeout_seconds

This commit is contained in:
Qiu Jian
2023-06-21 13:01:07 +08:00
parent a4a64c128a
commit 96581515d1
4 changed files with 18 additions and 6 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ import (
"net"
"os"
"strconv"
"time"
"yunion.io/x/log"
@@ -31,7 +32,7 @@ func InitApp(options *common_options.BaseOptions, dbAccess bool) *appsrv.Applica
log.Infof("RequestWorkerCount: %d", options.RequestWorkerCount)
app := appsrv.NewApplication(options.ApplicationID, options.RequestWorkerCount, dbAccess)
app.CORSAllowHosts(options.CorsHosts)
app.SetDefaultTimeout(time.Duration(options.DefaultProcessTimeoutSeconds) * time.Second)
// app.SetContext(appsrv.APP_CONTEXT_KEY_CACHE, cache)
// if dbConn != nil {
// app.SetContext(appsrv.APP_CONTEXT_KEY_DB, dbConn)
+2
View File
@@ -71,6 +71,8 @@ type BaseOptions struct {
RequestWorkerCount int `default:"8" help:"Request worker thread count, default is 8"`
TaskWorkerCount int `default:"4" help:"Task manager worker thread count, default is 4"`
DefaultProcessTimeoutSeconds int `default:"60" help:"request process timeout, default is 60 seconds"`
EnableSsl bool `help:"Enable https"`
SslCaCerts string `help:"ssl certificate ca root file, separating ca and cert file is not encouraged" alias:"ca-file"`
SslCertfile string `help:"ssl certification file, normally combines all the certificates in the chain" alias:"cert-file"`