Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pagination termination condition correction.

  • Loading branch information...
commit 845325fdff6ea5d5fc5966af7d4631a2e0bcf9be 1 parent 03eaf17
@notmatt notmatt authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/cloudapi.js
View
5 lib/cloudapi.js
@@ -633,7 +633,8 @@ CloudAPI.prototype.countMachines = function(account, options, callback) {
var done = true;
if (headers['x-resource-count'] && headers['x-query-limit'])
- done = (headers['x-resource-count'] < headers['x-query-limit']);
+ done = (parseInt(headers['x-resource-count'], 10) <
+ parseInt(headers['x-query-limit'], 10) * (req.query.offset + 1));
var count = +headers['x-resource-count'];
@@ -723,7 +724,7 @@ CloudAPI.prototype.listMachines = function(account, options, tags, callback) {
var done = true;
if (headers['x-resource-count'] && headers['x-query-limit'])
done = (parseInt(headers['x-resource-count'], 10) <
- parseInt(headers['x-query-limit'], 10));
+ parseInt(headers['x-query-limit'], 10) * (req.query.offset + 1));
log.debug('CloudAPI._get(%s) -> err=%o, obj=%o, done=%s',
req.path, err, obj, done);
Please sign in to comment.
Something went wrong with that request. Please try again.