Merge pull request #5486 from wanyaoqi/automated-cherry-pick-of-#5484-upstream-release-3.1

Automated cherry pick of #5484: download handler set no timeout
This commit is contained in:
yunion-ci-robot
2020-03-13 14:33:02 +08:00
committed by GitHub
2 changed files with 1 additions and 5 deletions
-3
View File
@@ -989,9 +989,6 @@ func (manager *SGuestManager) validateCreateData(
if err != nil {
return nil, httperrors.NewInputParameterError("Invalid root image: %s", err)
}
if len(diskConfig.SnapshotId) > 0 && diskConfig.DiskType != api.DISK_TYPE_SYS {
return nil, httperrors.NewBadRequestError("Snapshot error: disk index 0 but disk type is %s", diskConfig.DiskType)
}
// if len(diskConfig.Backend) == 0 {
// diskConfig.Backend = STORAGE_LOCAL
+1 -2
View File
@@ -18,7 +18,6 @@ import (
"context"
"fmt"
"net/http"
"time"
"yunion.io/x/onecloud/pkg/appsrv"
"yunion.io/x/onecloud/pkg/hostman/hostutils"
@@ -65,7 +64,7 @@ func AddDownloadHandler(prefix string, app *appsrv.Application) {
func customizeHandlerInfo(info *appsrv.SHandlerInfo) {
switch info.GetName(nil) {
case "disk_download", "download", "snapshot_download":
info.SetProcessTimeout(time.Minute * 60).SetWorkerManager(streamingWorkerMan)
info.SetProcessNoTimeout().SetWorkerManager(streamingWorkerMan)
}
}