From 3c2cc79b05006f1688efd0310a5779b50855108a Mon Sep 17 00:00:00 2001 From: hexxa Date: Sat, 5 Mar 2022 17:18:53 +0800 Subject: [PATCH] fix(bolt_store): use existing uploading info instead returing error --- src/db/boltstore/bolt_store.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/db/boltstore/bolt_store.go b/src/db/boltstore/bolt_store.go index 42339e6..f31eec5 100644 --- a/src/db/boltstore/bolt_store.go +++ b/src/db/boltstore/bolt_store.go @@ -100,11 +100,10 @@ func (bs *BoltStore) setUploadInfo(tx *bolt.Tx, userID uint64, uploadPath string } } - existingInfo := uploadInfoBucket.Get([]byte(uploadPath)) - if existingInfo != nil && !overWrite { - return db.ErrCreateExisting + existingInfoBytes := uploadInfoBucket.Get([]byte(uploadPath)) + if existingInfoBytes != nil { + return nil } - uploadInfoBytes, err := json.Marshal(uploadInfo) if err != nil { return err