Skip to content

Commit

Permalink
Move some things outside the loop
Browse files Browse the repository at this point in the history
plorenz committed Jul 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 05db6bf commit b9ad1eb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ziti/client.go
Original file line number Diff line number Diff line change
@@ -331,16 +331,18 @@ func (self *CtrlClient) GetServices() ([]*rest_model.ServiceDetail, error) {
params := service.NewListServicesParams()

pageOffset := int64(0)

pageLimit := int64(500)
params.Limit = &pageLimit

if self.supportsSetOfConfigTypesOnServiceList() {
params.ConfigTypes = self.ConfigTypes
}

var services []*rest_model.ServiceDetail

for {
params.Limit = &pageLimit
params.Offset = &pageOffset
if self.supportsSetOfConfigTypesOnServiceList() {
params.ConfigTypes = self.ConfigTypes
}
resp, err := self.API.Service.ListServices(params, self.GetCurrentApiSession())

if err != nil {

0 comments on commit b9ad1eb

Please sign in to comment.