mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user