diff --git a/lib/cartodb/api/user_limits_api.js b/lib/cartodb/api/user_limits_api.js index 7f244e7d..7e004e31 100644 --- a/lib/cartodb/api/user_limits_api.js +++ b/lib/cartodb/api/user_limits_api.js @@ -81,10 +81,13 @@ UserLimitsApi.prototype.getTimeoutRenderLimit = function (username, apiKey, call }); }, function getUserTimeoutRenderLimits(err, authorized) { + var next = this; + if (err) { return next(err); } - self.metadataBackend.getUserTimeoutRenderLimits(username, authorized, this); + + self.metadataBackend.getUserTimeoutRenderLimits(username, authorized, next); }, function setTilerRenderLimit(err, timeoutRenderLimit) { if (err) { diff --git a/test/acceptance/user-timeout-limit.js b/test/acceptance/user-timeout-limit.js index 0c75dce2..c83db965 100644 --- a/test/acceptance/user-timeout-limit.js +++ b/test/acceptance/user-timeout-limit.js @@ -69,7 +69,7 @@ describe('user timeout limits', function () { var mapConfig = createMapConfig(TestClient.CARTOCSS.POINTS); var testClient = new TestClient(mapConfig, 1234); - testClient.getTile(4, 4, 4, {}, function (err, /* res, tile */) { + testClient.getTile(4, 4, 4, {}, function (err /*, res, tile */) { assert.ok(err, err); // TODO: check timeout tile testClient.drain(done);