Merge pull request #14057 from ioito/hotfix/qx-apigateway-export-timeout

fix(apigateway): log export timeout
This commit is contained in:
Zexi Li
2022-04-18 14:39:31 +08:00
committed by GitHub
+2 -1
View File
@@ -19,6 +19,7 @@ import (
"fmt"
"net/http"
"path"
"strings"
"time"
"yunion.io/x/onecloud/pkg/appsrv"
@@ -56,7 +57,7 @@ func (h SHandler) Bind(app *appsrv.Application) {
hi := appsrv.NewHandlerInfo(h.Method, segs, f, nil, "", nil)
if h.Method == "GET" {
hi.SetProcessTimeoutCallback(func(hdr *appsrv.SHandlerInfo, r *http.Request) time.Duration {
if len(r.URL.Query().Get("export_keys")) > 0 {
if len(r.URL.Query().Get("export_keys")) > 0 || strings.HasSuffix(r.URL.Path, "/splitable-export") {
return time.Hour * 2
}
return -time.Second