]> 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 d0cf4d5deca5a3af11b383c7da53642b78b5286c..f4a2b358b4f048e1da746ae44fa9c920509c104c 100644 (file)
@@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 455
+const LAST_MIGRATION_VERSION = 465
 
 // ---------------------------------------------------------------------------
 
@@ -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' ],
@@ -291,6 +291,9 @@ const CONSTRAINTS_FIELDS = {
   PLUGINS: {
     NAME: { min: 1, max: 214 }, // Length
     DESCRIPTION: { min: 1, max: 20000 } // Length
+  },
+  COMMONS: {
+    URL: { min: 5, max: 2000 } // Length
   }
 }
 
@@ -483,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
 
@@ -569,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 = {
@@ -725,6 +733,7 @@ export {
   ACTIVITY_PUB_ACTOR_TYPES,
   THUMBNAILS_SIZE,
   VIDEO_CATEGORIES,
+  MEMOIZE_LENGTH,
   VIDEO_LANGUAGES,
   VIDEO_PRIVACIES,
   VIDEO_LICENCES,