remove query_format rate limit

This commit is contained in:
Simon Martín 2018-12-10 18:20:10 +01:00
parent 498ddc58b7
commit 254896e666
6 changed files with 6 additions and 12 deletions

View File

@ -2,7 +2,6 @@
const RATE_LIMIT_ENDPOINTS_GROUPS = {
QUERY: 'query',
QUERY_FORMAT: 'query_format',
JOB_CREATE: 'job_create',
JOB_GET: 'job_get',
JOB_DELETE: 'job_delete',
@ -21,23 +20,23 @@ function rateLimit(userLimits, endpointGroup = null) {
if (err) {
return next(err);
}
if (!userRateLimit) {
return next();
}
const [isBlocked, limit, remaining, retry, reset] = userRateLimit;
res.set({
'Carto-Rate-Limit-Limit': limit,
'Carto-Rate-Limit-Remaining': remaining,
'Carto-Rate-Limit-Reset': reset
});
if (isBlocked) {
// retry is floor rounded in seconds by redis-cell
res.set('Retry-After', retry + 1);
const rateLimitError = new Error(
'You are over platform\'s limits. Please contact us to know more details'
);
@ -46,7 +45,7 @@ function rateLimit(userLimits, endpointGroup = null) {
rateLimitError.detail = 'rate-limit';
return next(rateLimitError);
}
return next();
});
};

View File

@ -74,7 +74,6 @@ function App(statsClient) {
rateLimitsEnabled: false,
endpoints: {
query: false,
query_format: false,
job_create: false,
job_get: false,
job_delete: false

View File

@ -117,7 +117,6 @@ module.exports.ratelimits = {
// whether it should rate limit one or more endpoints (only if rateLimitsEnabled = true)
endpoints: {
query: false,
query_format: false,
job_create: false,
job_get: false,
job_delete: false

View File

@ -121,7 +121,6 @@ module.exports.ratelimits = {
// whether it should rate limit one or more endpoints (only if rateLimitsEnabled = true)
endpoints: {
query: false,
query_format: false,
job_create: false,
job_get: false,
job_delete: false

View File

@ -118,7 +118,6 @@ module.exports.ratelimits = {
// whether it should rate limit one or more endpoints (only if rateLimitsEnabled = true)
endpoints: {
query: false,
query_format: false,
job_create: false,
job_get: false,
job_delete: false

View File

@ -118,7 +118,6 @@ module.exports.ratelimits = {
// whether it should rate limit one or more endpoints (only if rateLimitsEnabled = true)
endpoints: {
query: false,
query_format: false,
job_create: false,
job_get: false,
job_delete: false