Skip to content

Commit

Permalink
Fix duplicated stats update and unused function clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
shino committed Jul 10, 2015
1 parent e2f959c commit 66f4012
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/riak_cs_wm_bucket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ accept_body(RD, Ctx=#context{user=User,
%% @doc Callback for deleting a bucket.
-spec delete_resource(#wm_reqdata{}, #context{}) ->
{boolean() | {'halt', term()}, #wm_reqdata{}, #context{}}.
delete_resource(RD, Ctx=#context{start_time=StartTime,
user=User,
delete_resource(RD, Ctx=#context{user=User,
user_object=UserObj,
response_module=ResponseMod,
bucket=Bucket,
Expand All @@ -162,7 +161,6 @@ delete_resource(RD, Ctx=#context{start_time=StartTime,
ok ->
riak_cs_dtrace:dt_bucket_return(?MODULE, <<"bucket_delete">>,
[200], [riak_cs_wm_utils:extract_name(User), Bucket]),
ok = riak_cs_stats:update_with_start([bucket, delete], StartTime),
{true, RD, Ctx};
{error, Reason} ->
Code = ResponseMod:status_code(Reason),
Expand Down
8 changes: 2 additions & 6 deletions src/riak_cs_wm_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,15 @@ streaming_get(RcPool, RcPid, FsmPid, StartTime, UserName, BFile_str) ->
{Chunk, fun() -> streaming_get(RcPool, RcPid, FsmPid, StartTime, UserName, BFile_str) end}
end.

-spec lower_case_method(atom() | string()) -> atom().
-spec lower_case_method(atom()) -> atom().
lower_case_method('GET') -> get;
lower_case_method('HEAD') -> head;
lower_case_method('POST') -> post;
lower_case_method('PUT') -> put;
lower_case_method('DELETE') -> delete;
lower_case_method('TRACE') -> trace;
lower_case_method('CONNECT') -> connect;
lower_case_method('OPTIONS') -> options;
lower_case_method(Method) when is_atom(Method) ->
lower_case_method(atom_to_list(Method));
lower_case_method(Method) when is_list(Method) ->
list_to_atom(string:to_lower(Method)).
lower_case_method('OPTIONS') -> options.

%% @doc Get an ISO 8601 formatted timestamp representing
%% current time.
Expand Down

11 comments on commit 66f4012

@kuenishi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from kuenishi
at 66f4012

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/riak_cs/feature/stats-at-wm-common = 66f4012 into borshop-integration-1180-feature/stats-at-wm-common

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/riak_cs/feature/stats-at-wm-common = 66f4012 merged ok, testing candidate = d4459b6

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kuenishi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop: retry

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from kuenishi
at 66f4012

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/riak_cs/feature/stats-at-wm-common = 66f4012 into borshop-integration-1180-feature/stats-at-wm-common

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/riak_cs/feature/stats-at-wm-common = 66f4012 merged ok, testing candidate = eff74e5

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding develop to borshop-integration-1180-feature/stats-at-wm-common = eff74e5

Please sign in to comment.