Feat: file uploading in slave mode

This commit is contained in:
HFO4
2019-12-28 13:14:00 +08:00
parent 6470340104
commit 132c7a8fcb
8 changed files with 85 additions and 9 deletions

View File

@@ -72,7 +72,11 @@ func (fs *FileSystem) GenerateThumbnail(ctx context.Context, file *model.File) {
}
// 更新文件的图像信息
err = file.UpdatePicInfo(fmt.Sprintf("%d,%d", w, h))
if file.Model.ID > 0 {
err = file.UpdatePicInfo(fmt.Sprintf("%d,%d", w, h))
} else {
file.PicInfo = fmt.Sprintf("%d,%d", w, h)
}
// 失败时删除缩略图文件
if err != nil {