Bläddra i källkod

:bug: Do not remove .tmp file when listing doc tree https://ld246.com/article/1702621572239

Daniel 1 år sedan
förälder
incheckning
0547f27839
1 ändrade filer med 0 tillägg och 8 borttagningar
  1. 0 8
      kernel/model/box.go

+ 0 - 8
kernel/model/box.go

@@ -257,14 +257,6 @@ func (box *Box) Ls(p string) (ret []*FileInfo, totals int, err error) {
 		if util.IsReservedFilename(name) {
 		if util.IsReservedFilename(name) {
 			continue
 			continue
 		}
 		}
-		if strings.HasSuffix(name, ".tmp") {
-			// 移除写入失败时产生的临时文件
-			removePath := filepath.Join(util.DataDir, box.ID, p, name)
-			if removeErr := os.Remove(removePath); nil != removeErr {
-				logging.LogWarnf("remove tmp file [%s] failed: %s", removePath, removeErr)
-			}
-			continue
-		}
 
 
 		totals += 1
 		totals += 1
 		fi := &FileInfo{}
 		fi := &FileInfo{}