Github user rnewson commented on a diff in the pull request:
https://github.com/apache/couchdb-couch/pull/161#discussion_r60071188
--- Diff: src/couch_file.erl ---
@@ -223,19 +223,33 @@ delete(RootDir, Filepath) ->
delete(RootDir, Filepath, Async) ->
- DelFile = filename:join([RootDir,".delete",
?b2l(couch_uuids:random())]),
+ DelFile = deleted_filename(RootDir, Filepath),
+ RenameOnDelete = config:get_boolean("couchdb", "rename_on_delete",
false),
case file:rename(Filepath, DelFile) of
- ok ->
- if (Async) ->
+ ok when RenameOnDelete ->
+ ok;
+ ok when Async ->
spawn(file, delete, [DelFile]),
ok;
- true ->
- file:delete(DelFile)
- end;
- Error ->
- Error
+ ok ->
--- End diff --
diff would have been clearer if you hadn't mixed whitespace changes with
functional changes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---