Skip to content

Commit

Permalink
fix(glance): image upload timeout (#19888)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito authored Apr 7, 2024
1 parent 9249682 commit e17ba97
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/image/models/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ 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 e17ba97

Please sign in to comment.