From 45adf8fba9f36b8e3cb6f7badbdb93893155c3e5 Mon Sep 17 00:00:00 2001
From: Alex Sharov <AskAlexSharov@gmail.com>
Date: Wed, 11 May 2022 14:38:37 +0700
Subject: [PATCH] Torrent: don't drop db on "torrent_hashes --rebuild" #4118 
 Open

---
 cmd/downloader/main.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmd/downloader/main.go b/cmd/downloader/main.go
index fa9c7a6ba9..8c25e3ab07 100644
--- a/cmd/downloader/main.go
+++ b/cmd/downloader/main.go
@@ -172,7 +172,7 @@ var printTorrentHashes = &cobra.Command{
 		}
 
 		if forceRebuild { // remove and create .torrent files (will re-read all snapshots)
-			removePieceCompletionStorage(snapshotDir)
+			//removePieceCompletionStorage(snapshotDir)
 			files, err := downloader.AllTorrentPaths(snapshotDir)
 			if err != nil {
 				return err
@@ -232,6 +232,7 @@ var printTorrentHashes = &cobra.Command{
 	},
 }
 
+//nolint
 func removePieceCompletionStorage(snapshotDir string) {
 	_ = os.RemoveAll(filepath.Join(snapshotDir, "db"))
 	_ = os.RemoveAll(filepath.Join(snapshotDir, ".torrent.db"))
-- 
GitLab