소스 검색

Close the temp file when dumping database to make the temp file can be deleted on Windows (#23249)

There was no `dbDump.Close()` before, Windows doesn't like to delete
opened files.
tags/v1.20.0-rc0
wxiaoguang 1 년 전
부모
커밋
294124d129
No account linked to committer's email address
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1
    0
      cmd/dump.go

+ 1
- 0
cmd/dump.go 파일 보기

@@ -272,6 +272,7 @@ func runDump(ctx *cli.Context) error {
fatal("Failed to create tmp file: %v", err)
}
defer func() {
_ = dbDump.Close()
if err := util.Remove(dbDump.Name()); err != nil {
log.Warn("Unable to remove temporary file: %s: Error: %v", dbDump.Name(), err)
}

Loading…
취소
저장