mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #14057 from ioito/hotfix/qx-apigateway-export-timeout
fix(apigateway): log export timeout
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user