eiri commented on a change in pull request #597: Move view index files to 
.view_deleted when db is deleted
URL: https://github.com/apache/couchdb/pull/597#discussion_r125812352
 
 

 ##########
 File path: src/couch/src/couch_file.erl
 ##########
 @@ -272,12 +282,20 @@ deleted_filename(Original) ->
             ++ filename:extension(Original), [Y, Mon, D, H, Min, S])),
     filename:rootname(Original) ++ Suffix.
 
-nuke_dir(RootDelDir, Dir) ->
+nuke_dir(RootDir, Dir) ->
+    nuke_dir(RootDir, Dir, []).
+nuke_dir(RootDelDir, Dir, Options) ->
     EnableRecovery = config:get_boolean("couchdb",
         "enable_database_recovery", false),
     case EnableRecovery of
         true ->
-            rename_file(Dir);
+            Context = couch_util:get_value(context, Options, compaction),
+            case Context =:= delete of
 
 Review comment:
   You can avoid `case` double-fold here with guards in condition, something 
like
   ```
   case EnableRecovery of
     true when Context == delete -> ...;
     true -> ...;
     false -> ...
   end
   ```
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to