Skip to content

Instantly share code, notes, and snippets.

@brandon-fryslie
Created November 20, 2015 20:43
Show Gist options
  • Save brandon-fryslie/ac9ec9d536d7794c2601 to your computer and use it in GitHub Desktop.
Save brandon-fryslie/ac9ec9d536d7794c2601 to your computer and use it in GitHub Desktop.
let startIndex = 0;
const pageSize = 200;
let promises = [];
while (startIndex < watches.length) {
promises.push(AlmApi.query('/artifact/', {
query: buildUUIDQuery(uuids.slice(startIndex, startIndex + pageSize)),
fetch: fetchFields,
pagesize: pageSize
}));
startIndex += pageSize;
}
return Promise.all(promises).then((responses) => {
responses = _(responses).pluck('results').flatten().value();
// flattened responses
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment