From d74d29ad9e35929491cf37223398d2535ab23de0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 19 Mar 2019 14:23:17 +0100 Subject: Limit user tokens cache --- server/initializers/constants.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'server/initializers/constants.ts') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 7fac8a4d6..7a3ec3874 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -660,7 +660,7 @@ const EMBED_SIZE = { } // Sub folders of cache directory -const CACHE = { +const FILES_CACHE = { PREVIEWS: { DIRECTORY: join(CONFIG.STORAGE.CACHE_DIR, 'previews'), MAX_AGE: 1000 * 3600 * 3 // 3 hours @@ -671,6 +671,12 @@ const CACHE = { } } +const CACHE = { + USER_TOKENS: { + MAX_SIZE: 10000 + } +} + const HLS_STREAMING_PLAYLIST_DIRECTORY = join(CONFIG.STORAGE.STREAMING_PLAYLISTS_DIR, 'hls') const HLS_REDUNDANCY_DIRECTORY = join(CONFIG.STORAGE.REDUNDANCY_DIR, 'hls') @@ -741,7 +747,7 @@ if (isTestInstance() === true) { JOB_ATTEMPTS['email'] = 1 - CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000 + FILES_CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000 MEMOIZE_TTL.OVERVIEWS_SAMPLE = 1 ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0ms' @@ -759,7 +765,7 @@ export { ACCEPT_HEADERS, BCRYPT_SALT_SIZE, TRACKER_RATE_LIMITS, - CACHE, + FILES_CACHE, CONFIG, CONSTRAINTS_FIELDS, EMBED_SIZE, @@ -799,6 +805,7 @@ export { VIDEO_TRANSCODING_FPS, FFMPEG_NICE, VIDEO_ABUSE_STATES, + CACHE, JOB_REQUEST_TIMEOUT, USER_PASSWORD_RESET_LIFETIME, MEMOIZE_TTL, -- cgit v1.2.3