From 4f5894d061ba050c9eb83b4f2c36665815c1ba3b Mon Sep 17 00:00:00 2001 From: ioito Date: Mon, 18 Apr 2022 14:23:22 +0800 Subject: [PATCH] fix(apigateway): log export timeout --- pkg/apigateway/handler/dispatcher.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/apigateway/handler/dispatcher.go b/pkg/apigateway/handler/dispatcher.go index 08dcd49c92..bf18d9685c 100644 --- a/pkg/apigateway/handler/dispatcher.go +++ b/pkg/apigateway/handler/dispatcher.go @@ -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