From 879e49d29a92a3951c97788e57f8402befccc343 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Thu, 3 Nov 2022 17:10:01 +0800 Subject: [PATCH] feature[oss:tempdir] fixed persist object failed error in localoss implement --- internal/dao/storage/localoss.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/internal/dao/storage/localoss.go b/internal/dao/storage/localoss.go index 503d64c5..f2ba55ab 100644 --- a/internal/dao/storage/localoss.go +++ b/internal/dao/storage/localoss.go @@ -102,10 +102,7 @@ func (s *localossCreateTempDirServant) PutObject(objectKey string, reader io.Rea func (s *localossCreateTempDirServant) PersistObject(objectKey string) error { fi, err := os.Stat(s.savePath + objectKey) - if err != nil { - return err - } - if !fi.IsDir() { + if err == nil && !fi.IsDir() { logrus.Debugf("object exist so do nothing objectKey: %s", objectKey) return nil }