This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_priority(Channel, DiskSize, DataSize, Threshold, Dir) -> | |
MinSize = list_to_integer(smoosh_utils:get(Channel, "min_size", "0")), | |
MaxSize = case smoosh_utils:get(Channel, "max_size", infinity) of | |
infinity -> infinity; | |
Value -> list_to_integer(Value) | |
end, | |
ProjectedCapacity = projected_capacity(Dir, DataSize), | |
MaxCapacity = list_to_integer( | |
couch_config:get("smoosh", "max_capacity", "90")), | |
BadSize = DiskSize =< MinSize orelse DiskSize > MaxSize, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PreCommDict = dict:from_list(PreCommitFailures), | |
{_, _, Tr} = lists:foldl(fun(#doc{id=Id,revs={Pos, RevIds}},{RidRevs,RCommitResults,Acc}) -> | |
DocKey = {Id, {Pos, RevIds}}, | |
case lists:keyfind(DocKey,1,RCommitResults) of | |
false -> | |
case dict:find(DocKey,PreCommDict) of | |
error -> | |
{_, GoodVal} = lists:keyfind(DocKey,1,RidRevs), | |
{lists:delete(DocKey,RidRevs), RCommitResults, [GoodVal | Acc]}; | |
{ok, PCommFailVal} -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
%% -*- erlang -*- | |
%%! -pa ./src/couchdb -sasl errlog_type error -boot start_sasl -noshell | |
%% | |
main(_) -> | |
code:add_pathz("src/couchdb"), | |
application:load(crypto), | |
crypto:start(), | |
etap:plan(unknown), | |
case (catch test()) of |