Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve upload asset to cloud error message

Daniel6bd1772f132d
diff --git a/kernel/model/assets.go b/kernel/model/assets.go
index d01f196ff8..8b85eb24de 100644
--- a/kernel/model/assets.go
+++ b/kernel/model/assets.go
@@ -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)
@@ -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
}