mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
remove keyprefix as not needed and
updates to package.json, redis import and git ignore
This commit is contained in:
1
api/.gitignore
vendored
1
api/.gitignore
vendored
@@ -6,3 +6,4 @@ debug.db
|
||||
test
|
||||
dist
|
||||
tmp
|
||||
.env
|
||||
|
||||
@@ -111,7 +111,8 @@
|
||||
"resolve-cwd": "^3.0.0",
|
||||
"sharp": "^0.25.4",
|
||||
"uuid": "^8.3.0",
|
||||
"uuid-validate": "0.0.3"
|
||||
"uuid-validate": "0.0.3",
|
||||
"rate-limiter-flexible": "^2.1.10"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"mssql": "^6.2.0",
|
||||
@@ -119,7 +120,6 @@
|
||||
"oracledb": "^5.0.0",
|
||||
"pg": "^8.3.0",
|
||||
"sqlite3": "^5.0.0",
|
||||
"rate-limiter-flexible": "^2.1.10",
|
||||
"redis": "^3.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import redis from 'redis';
|
||||
import {
|
||||
RateLimiterRedis,
|
||||
RateLimiterMemory,
|
||||
@@ -6,8 +5,8 @@ import {
|
||||
IRateLimiterOptions,
|
||||
} from 'rate-limiter-flexible';
|
||||
import camelcase from 'camelcase';
|
||||
import { RedisNotFoundException } from '../exceptions';
|
||||
import env from '../env';
|
||||
import { RedisNotFoundException } from './exceptions';
|
||||
import env from './env';
|
||||
|
||||
// options for the rate limiter are set below. Opts can be found
|
||||
// at https://github.com/animir/node-rate-limiter-flexible/wiki/Options
|
||||
@@ -22,7 +21,6 @@ export default rateLimiterConfig;
|
||||
|
||||
function getRateLimiterConfig(): IRateLimiterOptions {
|
||||
const config: any = {};
|
||||
config.keyPrefix = 'rlflx';
|
||||
for (const [key, value] of Object.entries(env)) {
|
||||
if (key === 'CONSUMED_POINTS_LIMIT') {
|
||||
config.points = value;
|
||||
@@ -38,6 +36,7 @@ function getRateLimiterConfig(): IRateLimiterOptions {
|
||||
}
|
||||
|
||||
function getRateLimiterRedisConfig(): IRateLimiterStoreOptions {
|
||||
const redis = require('redis');
|
||||
const redisConfig: any = {};
|
||||
const redisClient = redis.createClient({
|
||||
enable_offline_queue: false,
|
||||
@@ -50,7 +49,6 @@ function getRateLimiterRedisConfig(): IRateLimiterStoreOptions {
|
||||
throw new RedisNotFoundException('Redis client does not exist');
|
||||
}
|
||||
|
||||
redisConfig.keyPrefix = 'rlflx';
|
||||
redisConfig.storeClient = redisClient;
|
||||
|
||||
for (const [key, value] of Object.entries(env)) {
|
||||
|
||||
Reference in New Issue
Block a user