feat(uploader): concurrent chunk uploads
This commit is contained in:
2
assets
2
assets
Submodule assets updated: d0540548cf...a095f8c612
@@ -101,6 +101,8 @@ type (
|
|||||||
SourceAuth bool `json:"source_auth,omitempty"`
|
SourceAuth bool `json:"source_auth,omitempty"`
|
||||||
// QiniuUploadCdn whether to use CDN for Qiniu upload.
|
// QiniuUploadCdn whether to use CDN for Qiniu upload.
|
||||||
QiniuUploadCdn bool `json:"qiniu_upload_cdn,omitempty"`
|
QiniuUploadCdn bool `json:"qiniu_upload_cdn,omitempty"`
|
||||||
|
// ChunkConcurrency the number of chunks to upload concurrently.
|
||||||
|
ChunkConcurrency int `json:"chunk_concurrency,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
FileType int
|
FileType int
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ type StoragePolicy struct {
|
|||||||
Type types.PolicyType `json:"type"`
|
Type types.PolicyType `json:"type"`
|
||||||
MaxSize int64 `json:"max_size"`
|
MaxSize int64 `json:"max_size"`
|
||||||
Relay bool `json:"relay,omitempty"`
|
Relay bool `json:"relay,omitempty"`
|
||||||
|
ChunkConcurrency int `json:"chunk_concurrency,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Entity struct {
|
type Entity struct {
|
||||||
@@ -452,11 +453,12 @@ func BuildStoragePolicy(sp *ent.StoragePolicy, hasher hashid.Encoder) *StoragePo
|
|||||||
}
|
}
|
||||||
|
|
||||||
res := &StoragePolicy{
|
res := &StoragePolicy{
|
||||||
ID: hashid.EncodePolicyID(hasher, sp.ID),
|
ID: hashid.EncodePolicyID(hasher, sp.ID),
|
||||||
Name: sp.Name,
|
Name: sp.Name,
|
||||||
Type: types.PolicyType(sp.Type),
|
Type: types.PolicyType(sp.Type),
|
||||||
MaxSize: sp.MaxSize,
|
MaxSize: sp.MaxSize,
|
||||||
Relay: sp.Settings.Relay,
|
Relay: sp.Settings.Relay,
|
||||||
|
ChunkConcurrency: sp.Settings.ChunkConcurrency,
|
||||||
}
|
}
|
||||||
|
|
||||||
if sp.Settings.IsFileTypeDenyList {
|
if sp.Settings.IsFileTypeDenyList {
|
||||||
|
|||||||
Reference in New Issue
Block a user