Skip to content

Commit

Permalink
fix(image): set image upload download timeout 4 hour (#19976)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito authored Apr 15, 2024
1 parent e3a9fe7 commit 5fee90b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pkg/image/models/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (manager *SImageManager) CustomizeHandlerInfo(info *appsrv.SHandlerInfo) {

switch info.GetName(nil) {
case "get_details", "create", "update":
info.SetProcessTimeout(time.Minute * 120).SetWorkerManager(imgStreamingWorkerMan)
info.SetProcessTimeout(time.Hour * 4).SetWorkerManager(imgStreamingWorkerMan)
}
}

Expand Down Expand Up @@ -195,14 +195,6 @@ func (manager *SImageManager) InitializeData() error {
return nil
}

func (manager *SImageManager) SetHandlerProcessTimeout(info *appsrv.SHandlerInfo, r *http.Request) time.Duration {
if r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, "/images") {
log.Debugf("upload image, set process timeout to 4 hour!!!")
return 4 * time.Hour
}
return manager.SSharableVirtualResourceBaseManager.SetHandlerProcessTimeout(info, r)
}

func (manager *SImageManager) GetPropertyDetail(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error) {
appParams := appsrv.AppContextGetParams(ctx)
appParams.OverrideResponseBodyWrapper = true
Expand Down

0 comments on commit 5fee90b

Please sign in to comment.