Skip to content

Commit

Permalink
Pagination termination condition correction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Smillie committed Sep 9, 2011
1 parent 845325f commit 74de9aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cloudapi.js
Expand Up @@ -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'];

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 74de9aa

Please sign in to comment.