mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-28 03:23:25 +08:00
fix: add process timeout option default_process_timeout_seconds
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user