Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch/pull/115#discussion_r41408779
  
    --- Diff: src/couch_server.erl ---
    @@ -538,20 +540,31 @@ db_closed(Server, Options) ->
             true -> Server
         end.
     
    -delete_db_file(RootDir, FullFilePath, Options) ->
    +delete_file(RootDir, FullFilePath, Options) ->
         Async = not lists:member(sync, Options),
         RenameOnDelete = config:get_boolean("couchdb", "rename_on_delete", 
false),
         case {Async, RenameOnDelete} of
             {_, true} ->
                 rename_on_delete(FullFilePath);
             {Async, false} ->
    -            couch_file:delete(RootDir, FullFilePath, Async)
    +            case couch_file:delete(RootDir, FullFilePath, Async) of
    +                ok -> {ok, deleted};
    +                Else -> Else
    +            end
         end.
     
     rename_on_delete(Original) ->
    +    DeletedFileName = deleted_filename(Original),
    +    case file:rename(Original, DeletedFileName) of
    +        ok -> {ok, {renamed, DeletedFileName}};
    +        Else -> Else
    +    end.
    +
    +deleted_filename(Original) ->
         {{Y,Mon,D}, {H,Min,S}} = calendar:universal_time(),
    +    UUID = ?b2l(couch_uuids:random()),
    --- End diff --
    
    no need for the uuid, timestamp suffices


---
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.
---

Reply via email to