]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Add infohash cache
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index 1b7b94d744a320b3aa2f2fa51834115fbc7c200a..f4a2b358b4f048e1da746ae44fa9c920509c104c 100644 (file)
@@ -572,7 +572,12 @@ const HLS_STREAMING_PLAYLIST_DIRECTORY = join(CONFIG.STORAGE.STREAMING_PLAYLISTS
 const HLS_REDUNDANCY_DIRECTORY = join(CONFIG.STORAGE.REDUNDANCY_DIR, 'hls')
 
 const MEMOIZE_TTL = {
-  OVERVIEWS_SAMPLE: 1000 * 3600 * 4 // 4 hours
+  OVERVIEWS_SAMPLE: 1000 * 3600 * 4, // 4 hours
+  INFO_HASH_EXISTS: 1000 * 3600 * 12 // 12 hours
+}
+
+const MEMOIZE_LENGTH = {
+  INFO_HASH_EXISTS: 200
 }
 
 const QUEUE_CONCURRENCY = {
@@ -728,6 +733,7 @@ export {
   ACTIVITY_PUB_ACTOR_TYPES,
   THUMBNAILS_SIZE,
   VIDEO_CATEGORIES,
+  MEMOIZE_LENGTH,
   VIDEO_LANGUAGES,
   VIDEO_PRIVACIES,
   VIDEO_LICENCES,