]> 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 7e26176536320c1d69850e9bcfb315caff683fed..f4a2b358b4f048e1da746ae44fa9c920509c104c 100644 (file)
@@ -46,7 +46,7 @@ const SORTABLE_COLUMNS = {
   VIDEO_ABUSES: [ 'id', 'createdAt', 'state' ],
   VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
   VIDEO_IMPORTS: [ 'createdAt' ],
-  VIDEO_COMMENT_THREADS: [ 'createdAt' ],
+  VIDEO_COMMENT_THREADS: [ 'createdAt', 'totalReplies' ],
   VIDEO_RATES: [ 'createdAt' ],
   BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ],
   FOLLOWERS: [ 'createdAt', 'state', 'score' ],
@@ -486,7 +486,7 @@ let PRIVATE_RSA_KEY_SIZE = 2048
 // Password encryption
 const BCRYPT_SALT_SIZE = 10
 
-const USER_PASSWORD_RESET_LIFETIME = 60000 * 5 // 5 minutes
+const USER_PASSWORD_RESET_LIFETIME = 60000 * 60 // 60 minutes
 
 const USER_EMAIL_VERIFY_LIFETIME = 60000 * 60 // 60 minutes
 
@@ -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,