-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fileserver: Add file_limit
option for browse
#6648
Conversation
d95c79e
to
1327fc6
Compare
file_limit
option for browse
48c5441
to
5a5452d
Compare
6d3dd2d
to
05261ec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
For bonus points, it could probably use an adapt test (can just add it to an existing file_server
test) to make sure it produces the correct JSON.
Thanks! This LGTM, but before I merge I have just one stupid nit: should it be called Similarly, |
I added the test and updated the constant name. I'm keeping the config name still as "file_limit". I can also change that if required. |
@mholt I don't want to pressure at all, but the CL still is approved but only needs your review to merge. It's the youngest review in the already approved CLs, so could you take a look, when you have time ? Then I can work on other issues too :) |
@@ -66,8 +66,15 @@ type Browse struct { | |||
// - `sort size` will sort by size in ascending order | |||
// The first option must be `sort_by` and the second option must be `order` (if exists). | |||
SortOptions []string `json:"sort,omitempty"` | |||
|
|||
// FileLimit limits the number of up to n DirEntry values in directory order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we document that -1 means no limit? (And 0 is default limit, which is currently 10,000)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge this, but I still think we should enhance the comment/docs before the final release; and maybe even mark this option as experimental since we don't quite understand its characteristics in the wild yet. Would you be able to help with that? I just don't have a chance right now. Thanks!
Yes, I can do this. I will send another PR soon. Thanks for the merge. |
This PR fixes the issue #6644 . I'm not sure about the config name
file_limit
, I prefermax_dir_limit
etc.The default is still 10000.As mentioned in the issue, this PR gave me some background on file serve, so I will try to look at paging as well. Please feel free to edit any documentation as you see fit.