Skip to content

Commit

Permalink
fixup! handlers/targets: add pagination support
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst committed Oct 31, 2023
1 parent 6b77acf commit 7108059
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions globals/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ var (
// DefaultMaxRequestSize is the maximum size of a request we allow by default
DefaultMaxRequestSize = int64(1024 * 1024)

// DefaultMaxPageSize is the maximum list page size allowed if not set in the config.
DefaultMaxPageSize = 1000

// ContextMaxRequestSizeTypeKey is a value to keep linters from complaining
// about clashing string identifiers
ContextMaxRequestSizeTypeKey ContextMaxRequestSizeType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ import (
const (
credentialDomain = "credential"
hostDomain = "host"
// The default max page size is used when one is not
// provided to NewService.
defaultMaxPageSize = 1000
)

// extraWorkerFilterFunc takes in a set of workers and returns another set,
Expand Down Expand Up @@ -178,7 +175,7 @@ func NewService(
return Service{}, errors.New(ctx, errors.InvalidParameter, op, "missing static credential repository")
}
if maxPageSize == 0 {
maxPageSize = uint(defaultMaxPageSize)
maxPageSize = uint(globals.DefaultMaxPageSize)
}
return Service{
repoFn: repoFn,
Expand Down

0 comments on commit 7108059

Please sign in to comment.