Github user iilyak commented on a diff in the pull request:
https://github.com/apache/couchdb-couch/pull/141#discussion_r55609035
--- Diff: src/couch_db_updater.erl ---
@@ -43,9 +43,10 @@ init({DbName, Filepath, Fd, Options}) ->
ok = couch_file:write_header(Fd, Header),
% delete any old compaction files that might be hanging around
RootDir = config:get("couchdb", "database_dir", "."),
- couch_file:delete(RootDir, Filepath ++ ".compact"),
- couch_file:delete(RootDir, Filepath ++ ".compact.data"),
- couch_file:delete(RootDir, Filepath ++ ".compact.meta");
+ DelOpts = [compaction],
+ couch_server:delete_file(RootDir, Filepath ++ ".compact", DelOpts),
+ couch_server:delete_file(RootDir, Filepath ++
".compact.data",DelOpts),
--- End diff --
We code use the same approach as
[here](https://github.com/apache/couchdb-couch/blob/master/src/couch_server.erl#L457:L459).
We could also extract this common code into helper function.
While doing so I would also remove [this
line](https://github.com/apache/couchdb-couch/blob/master/src/couch_server.erl#L460).
Since the very same file is removed couple of lines above.
---
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.
---