Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'origin/2.0.1'

Change-Id: I7400f8a1c8a4eb990b6d330d415e84bfb027a0c5
  • Loading branch information...
commit c986feb35058144be102e5d993e18be45b6be183 2 parents f101aa1 + dc873dd
@fdmanana fdmanana authored
View
1  src/couch_set_view/src/couch_set_view.erl
@@ -484,6 +484,7 @@ cleanup_index_files(SetName) ->
[SetName, string:join(DeleteFiles, "\n")])
end,
RootDir = couch_config:get("couchdb", "view_index_dir"),
+ couch_file:init_delete_dir(RootDir),
lists:foreach(
fun(File) -> couch_file:delete(RootDir, File, false) end,
DeleteFiles).
View
5 src/couchdb/couch_file.erl
@@ -247,8 +247,9 @@ init_delete_dir(RootDir) ->
file2:ensure_dir(filename:join(Dir,"foo")),
file2:fold_files(Dir, ".*", true,
fun(Filename, _) ->
- ok = file2:delete(Filename)
- end, ok).
+ _ = file2:delete(Filename)
+ end, ok),
+ ok.
read_header(Fd) ->
View
4 src/couchdb/couch_view.erl
@@ -122,12 +122,14 @@ cleanup_index_files(Db) ->
re:run(FilePath, RegExp, [{capture, none}]) =:= nomatch]
end,
+ RootDir = couch_config:get("couchdb", "view_index_dir"),
+ couch_file:init_delete_dir(RootDir),
+
case DeleteFiles of
[] ->
ok;
_ ->
?LOG_DEBUG("deleting unused view index files: ~p", [DeleteFiles]),
- RootDir = couch_config:get("couchdb", "view_index_dir"),
[couch_file:delete(RootDir, File, false) || File <- DeleteFiles]
end,
ok.
Please sign in to comment.
Something went wrong with that request. Please try again.