mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-07 10:00:23 +08:00
TUN-5262: Allow to configure max fetch size for listing queries
This can be useful/important for accounts with many tunnels that exceed the 1000 default page size. There are various tunnel subcommands that use listing underneath, so we make that flag a tunnel one, rather than adding it to each subcommand.
This commit is contained in:
@@ -336,6 +336,10 @@ func (sc *subcommandContext) tunnelActive(name string) (*tunnelstore.Tunnel, boo
|
||||
filter := tunnelstore.NewFilter()
|
||||
filter.NoDeleted()
|
||||
filter.ByName(name)
|
||||
if maxFetch := sc.c.Uint("max-fetch-size"); maxFetch > 0 {
|
||||
filter.MaxFetchSize(maxFetch)
|
||||
}
|
||||
|
||||
tunnels, err := sc.list(filter)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
@@ -385,6 +389,10 @@ func (sc *subcommandContext) findIDs(inputs []string) ([]uuid.UUID, error) {
|
||||
// First, look up all tunnels the user has
|
||||
filter := tunnelstore.NewFilter()
|
||||
filter.NoDeleted()
|
||||
if maxFetch := sc.c.Uint("max-fetch-size"); maxFetch > 0 {
|
||||
filter.MaxFetchSize(maxFetch)
|
||||
}
|
||||
|
||||
tunnels, err := sc.list(filter)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user