-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Add page size limit #715
Add page size limit #715
Conversation
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.
Looks good! I think this is going to be a very useful feature. I added some remarks and ideas ..
storage[AppPaginationKey.self]?.pageSizeLimit | ||
} | ||
nonmutating set { | ||
storage[AppPaginationKey.self] = .init(pageSizeLimit: newValue) |
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.
@gwynne do we need to wrap this in a lock?
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.
Since this is a global setting, set once during startup, I'd avoid diving into that too much.
The tests are failing due to unrelated changes.
Besides reporting these I think we should update CI to not depend on nightly builds. @gwynne @0xTim agreed? |
@siemensikkema agree, for most things we should probably be testing with lowest supported version (5.2 release) and current release (5.4). It might be beneficial to test against latest master to catch Swift regressions but there's no point testing against a nightly build of a released Swift version |
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.
LGTM
These changes are now available in 4.3.0 |
Adds a means to prevent server overloads by limiting the maximum amount of elements returned in a single page.
Application
andRequest
have been extended with setters for page size limits. Set limits using the newly introducedPageLimit
type.This PR depends on: vapor/fluent-kit#412