Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
support for _view_cleanup via HTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
kocolosk committed Sep 3, 2010
1 parent 5a77f11 commit bcd9ed8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/chttpd/src/chttpd_db.erl
Expand Up @@ -118,9 +118,9 @@ handle_compact_req(Req, _) ->
Msg = <<"Compaction is handled automatically by Cloudant">>,
couch_httpd:send_error(Req, 403, forbidden, Msg).

handle_view_cleanup_req(Req, _) ->
Msg = <<"Old view indices are purged automatically by Cloudant">>,
couch_httpd:send_error(Req, 403, forbidden, Msg).
handle_view_cleanup_req(Req, Db) ->
ok = fabric:cleanup_index_files(Db),
send_json(Req, 202, {[{ok, true}]}).

handle_design_req(#httpd{
path_parts=[_DbName, _Design, Name, <<"_",_/binary>> = Action | _Rest],
Expand Down
3 changes: 2 additions & 1 deletion apps/fabric/src/fabric.erl
Expand Up @@ -189,7 +189,8 @@ cleanup_index_files(DbName) ->
re:run(FilePath, RegExp, [{capture, none}]) == nomatch
end, FileList)
end,
[file:delete(File) || File <- DeleteFiles].
[file:delete(File) || File <- DeleteFiles],
ok.

%% some simple type validation and transcoding

Expand Down

0 comments on commit bcd9ed8

Please sign in to comment.