Skip to content

Commit

Permalink
🎨 Improve upload asset to cloud error message
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed May 14, 2024
1 parent 1ce56de commit 6bd1772
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kernel/model/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ func uploadAssets2Cloud(assetPaths []string, bizType string) (count int, err err
metaType = "4"
}

pushErrMsgCount := 0
var completedUploadAssets []string
for _, absAsset := range uploadAbsAssets {
fi, statErr := os.Stat(absAsset)
Expand All @@ -616,8 +617,11 @@ func uploadAssets2Cloud(assetPaths []string, bizType string) (count int, err err

if limitSize < uint64(fi.Size()) {
logging.LogWarnf("file [%s] larger than limit size [%s], ignore uploading it", absAsset, humanize.IBytes(limitSize))
msg := fmt.Sprintf(Conf.Language(247), filepath.Base(absAsset), humanize.IBytes(limitSize))
util.PushErrMsg(msg, 30000)
if 3 > pushErrMsgCount {
msg := fmt.Sprintf(Conf.Language(247), filepath.Base(absAsset), humanize.IBytes(limitSize))
util.PushErrMsg(msg, 30000)
}
pushErrMsgCount++
continue
}

Expand Down

0 comments on commit 6bd1772

Please sign in to comment.