| @@ -58,9 +58,11 @@ func (u *Uploader) BeginUpdate(pkgID clitypes.PackageID, affinity clitypes.UserS | |||||
| for _, space := range spaceDetails { | for _, space := range spaceDetails { | ||||
| latency := time.Duration(math.MaxInt64) | latency := time.Duration(math.MaxInt64) | ||||
| con, ok := cons[space.RecommendHub.HubID] | |||||
| if ok && con.Latency != nil { | |||||
| latency = *con.Latency | |||||
| if space.RecommendHub != nil { | |||||
| con, ok := cons[space.RecommendHub.HubID] | |||||
| if ok && con.Latency != nil { | |||||
| latency = *con.Latency | |||||
| } | |||||
| } | } | ||||
| uploadSpaces = append(uploadSpaces, UploadSpaceInfo{ | uploadSpaces = append(uploadSpaces, UploadSpaceInfo{ | ||||
| @@ -54,7 +54,8 @@ func (u *Uploader) UserSpaceUpload(userSpaceID clitypes.UserSpaceID, rootPath st | |||||
| }) | }) | ||||
| var uploadSpaces []UploadSpaceInfo | var uploadSpaces []UploadSpaceInfo | ||||
| if !stgglb.StandaloneMode { | |||||
| // TODO 应该要分离Standalone模式和RecommendHub为nil的情况 | |||||
| if !stgglb.StandaloneMode && srcSpace.RecommendHub != nil { | |||||
| coorCli := stgglb.CoordinatorRPCPool.Get() | coorCli := stgglb.CoordinatorRPCPool.Get() | ||||
| defer coorCli.Release() | defer coorCli.Release() | ||||
| @@ -3,15 +3,11 @@ | |||||
| "locationID": 1 | "locationID": 1 | ||||
| }, | }, | ||||
| "hubRPC": { | "hubRPC": { | ||||
| "rootCA": "", | |||||
| "clientCert": "", | |||||
| "clientKey": "" | |||||
| "rootCA": "" | |||||
| }, | }, | ||||
| "coordinatorRPC": { | "coordinatorRPC": { | ||||
| "address": "127.0.0.1:5009", | "address": "127.0.0.1:5009", | ||||
| "rootCA": "", | |||||
| "clientCert": "", | |||||
| "clientKey": "" | |||||
| "rootCA": "" | |||||
| }, | }, | ||||
| "logger": { | "logger": { | ||||
| "output": "stdout", | "output": "stdout", | ||||
| @@ -41,7 +41,6 @@ type StorageType interface { | |||||
| } | } | ||||
| var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[StorageType]( | var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[StorageType]( | ||||
| // (*MashupStorageType)(nil), | |||||
| (*LocalType)(nil), | (*LocalType)(nil), | ||||
| (*OBSType)(nil), | (*OBSType)(nil), | ||||
| (*OSSType)(nil), | (*OSSType)(nil), | ||||
| @@ -50,22 +49,6 @@ var _ = serder.UseTypeUnionInternallyTagged(types.Ref(types.NewTypeUnion[Storage | |||||
| (*S3Type)(nil), | (*S3Type)(nil), | ||||
| )), "type") | )), "type") | ||||
| // // 多种存储服务的混合存储服务。需谨慎选择存储服务的组合,避免出Bug | |||||
| // type MashupStorageType struct { | |||||
| // serder.Metadata `union:"Mashup"` | |||||
| // Type string `json:"type"` | |||||
| // Store StorageType `json:"store"` // 创建ShardStore或BaseStore时,使用的存储服务类型 | |||||
| // Feature StorageType `json:"feature"` // 根据Feature创建组件时使用的存储服务类型 | |||||
| // } | |||||
| // func (a *MashupStorageType) GetStorageType() string { | |||||
| // return "Mashup" | |||||
| // } | |||||
| // func (a *MashupStorageType) String() string { | |||||
| // return "Mashup" | |||||
| // } | |||||
| type LocalType struct { | type LocalType struct { | ||||
| serder.Metadata `union:"Local"` | serder.Metadata `union:"Local"` | ||||
| Type string `json:"type"` | Type string `json:"type"` | ||||