Skip to content

Commit

Permalink
Fixed infinite loop (when API fails) for CSV function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesús Ángel committed Jan 15, 2019
1 parent 53920c7 commit 85005a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/controllers/wazuh-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ export class WazuhApiCtrl {
params.offset = 0;
const { totalItems } = output.body.data;
itemsArray.push(...output.body.data.items);
while (itemsArray.length < totalItems) {
while (itemsArray.length < totalItems && params.offset < totalItems) {
params.offset += params.limit;
const tmpData = await needle(
'get',
Expand Down

0 comments on commit 85005a1

Please sign in to comment.