diff --git a/lib/cartodb/backends/user-limits.js b/lib/cartodb/backends/user-limits.js index 519f1cd1..3a137269 100644 --- a/lib/cartodb/backends/user-limits.js +++ b/lib/cartodb/backends/user-limits.js @@ -1,5 +1,3 @@ -var step = require('step'); - /** * * @param metadataBackend @@ -43,41 +41,39 @@ UserLimitsBackend.prototype.getRenderLimits = function (username, apiKey, callba UserLimitsBackend.prototype.getTimeoutRenderLimit = function (username, apiKey, callback) { var self = this; - step( - function isAuthorized() { - var next = this; + function isAuthorized() { + var next = this; - if (!apiKey) { - return next(null, false); - } - - self.metadataBackend.getUserMapKey(username, function (err, userApiKey) { - if (err) { - return next(err); - } - - return next(null, userApiKey === apiKey); - }); - }, - function getUserTimeoutRenderLimits(err, authorized) { - var next = this; + if (!apiKey) { + return next(null, false); + } + self.metadataBackend.getUserMapKey(username, function (err, userApiKey) { if (err) { return next(err); } - self.metadataBackend.getUserTimeoutRenderLimits(username, function (err, timeoutRenderLimit) { - if (err) { - return next(err); - } + return next(null, userApiKey === apiKey); + }); + }, + function getUserTimeoutRenderLimits(err, authorized) { + var next = this; - next(null, { - render: authorized ? timeoutRenderLimit.render : timeoutRenderLimit.renderPublic - }); + if (err) { + return next(err); + } + + self.metadataBackend.getUserTimeoutRenderLimits(username, function (err, timeoutRenderLimit) { + if (err) { + return next(err); + } + + next(null, { + render: authorized ? timeoutRenderLimit.render : timeoutRenderLimit.renderPublic }); - }, - callback - ); + }); + }, + callback }; UserLimitsBackend.prototype.preprareRateLimit = function () {