From 7c658d8b14ea5bff69160a857115963dfb358898 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 26 Oct 2022 09:53:03 +0800 Subject: [PATCH] only check the file size, the file is not corrupted even close error --- client/file/watcher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/file/watcher.go b/client/file/watcher.go index 3d53fbf68b..739017ea2e 100644 --- a/client/file/watcher.go +++ b/client/file/watcher.go @@ -116,7 +116,7 @@ func (w *BlockFileWatcher) fetch(blockNum int) error { path := w.getFilePath(blockNum) f, err := os.Open(path) if err == nil { - defer f.Close() + defer f.Close() //nolint // valid 1st 8 bytes for downloaded file var bytes [8]byte if _, err = io.ReadFull(f, bytes[:]); err == nil { @@ -125,7 +125,7 @@ func (w *BlockFileWatcher) fetch(blockNum int) error { return nil } } - f.Close() + f.Close() //nolint } // download if file not exist