Skip to content
Browse files

Pagination termination condition correction.

  • Loading branch information...
1 parent 845325f commit 74de9aa64893c98e1a657ac81b4bb824ea51961e @notmatt notmatt committed Sep 8, 2011
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);

0 comments on commit 74de9aa

Please sign in to comment.
Something went wrong with that request. Please try again.