You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2019/09/09 06:32:31 UTC

[couchdb] 01/01: fixup fabric:cleanup_index_files

This is an automated email from the ASF dual-hosted git repository.

jiangphcn pushed a commit to branch fabric-cleanup-view-files
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit b79916d468ab81bd226c7bcbe348ce03414cfd6b
Author: jiangph <ji...@cn.ibm.com>
AuthorDate: Mon Sep 9 14:31:51 2019 +0800

    fixup fabric:cleanup_index_files
---
 src/fabric/src/fabric.erl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/fabric/src/fabric.erl b/src/fabric/src/fabric.erl
index d98ffc9..29c3449 100644
--- a/src/fabric/src/fabric.erl
+++ b/src/fabric/src/fabric.erl
@@ -525,7 +525,10 @@ inactive_index_files(DbName) ->
 
     if ActiveSigs =:= [] -> FileList; true ->
         lists:filter(fun(FilePath) ->
-            not maps:is_key(filename:basename(FilePath, ".view"), ActiveSigs)
+            ViewFilePath = filename:basename(FilePath, ".view"),
+            CompactViewFilePath = filename:basename(FilePath, "compact.view"),
+            (not maps:is_key(ViewFilePath, ActiveSigs))
+                and (not maps:is_key(CompactViewFilePath, ActiveSigs))
         end, FileList)
     end.