davisp commented on a change in pull request #1804: Make view query limits 
configurable
URL: https://github.com/apache/couchdb/pull/1804#discussion_r249522625
 
 

 ##########
 File path: src/couch_mrview/src/couch_mrview_util.erl
 ##########
 @@ -523,6 +525,33 @@ validate_args(#mrst{} = State, Args0) ->
     end.
 
 
+apply_limit(ViewPartitioned, Args) ->
+    LimitType = case ViewPartitioned of
+        true -> "partition_query_limit";
+        false -> "query_limit"
+    end,
+    
+    MaxLimit = config:get_integer("query_server_config",
+        LimitType, ?MAX_VIEW_LIMIT),
+
+    % set the highest limit possible if a user has not 
+    % specified a limit
+    Args1 = case Args#mrargs.limit =:= ?MAX_VIEW_LIMIT
+        andalso MaxLimit =/= infinity of
+        false ->
+            Args;
+        true ->
+            Args#mrargs{
+                limit = MaxLimit
+            }
+    end,
+
+    if Args1#mrargs.limit =< MaxLimit -> Args1; true ->
+        Fmt = "Limit is too large, must not exceed ~p",
 
 Review comment:
   Something is wrong here but I'm not immediately seeing why. The 
view_multi_key_design.js test has failed with this error message on each 
worker. Perhaps we left a bad config from an unrelated test?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to