Skip to content

Commit 21b99a8

Browse files
author
yangsen
committed
check file stat first after download
1 parent 8b3f344 commit 21b99a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

iqshell/storage/object/download/downloader.go

+6
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ func Download(info *ApiInfo) (res *ApiResult, err *data.CodeError) {
152152
return
153153
}
154154

155+
if fStatus, sErr := os.Stat(f.toAbsFile); sErr != nil {
156+
return res, data.NewEmptyError().AppendDesc("get file stat error after download").AppendError(sErr)
157+
} else {
158+
res.FileModifyTime = fStatus.ModTime().Unix()
159+
}
160+
155161
// 检查下载后的数据是否符合预期
156162
checkResult, mErr := object.Match(object.MatchApiInfo{
157163
Bucket: info.Bucket,

0 commit comments

Comments
 (0)