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 74de9aa64893c98e1a657ac81b4bb824ea51961e 1 parent 845325f
@notmatt notmatt authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/cloudapi.js
View
4 lib/cloudapi.js
@@ -634,7 +634,7 @@ CloudAPI.prototype.countMachines = function(account, options, 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) * (req.query.offset + 1));
+ parseInt(headers['x-query-limit'], 10) + req.query.offset);
var count = +headers['x-resource-count'];
@@ -724,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) * (req.query.offset + 1));
+ parseInt(headers['x-query-limit'], 10) + req.query.offset);
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.