Skip to content

Commit 56f1b13

Browse files
authored
Merge pull request #100 from hazcod/feat/warnings
fix: do not skip one host during fetch
2 parents ea0e609 + 94fb627 commit 56f1b13

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/falcon/extractor.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,12 @@ func GetMessages(config *config.Config, ctx context.Context) (results map[string
179179
allHostDetails := make([]*models.DeviceapiDeviceSwagger, 0)
180180

181181
step := 100
182-
sliceStart := 0
183-
sliceEnd := sliceStart + step
184182

185-
for {
183+
for sliceStart := 0; sliceStart < len(hostResult.Payload.Resources); sliceStart += step {
184+
sliceEnd := sliceStart + step
185+
if sliceEnd > len(hostResult.Payload.Resources) {
186+
sliceEnd = len(hostResult.Payload.Resources)
187+
}
186188

187189
if sliceEnd == len(hostResult.Payload.Resources)-1 {
188190
break

0 commit comments

Comments
 (0)