]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.js
Pod model refractoring -> use mongoose api
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.js
index 22cbb13619a6671152744c671c1c2fa9af08307a..55c555d04c086eff23236e0d5be59758506270d3 100644 (file)
@@ -4,7 +4,10 @@
 const API_VERSION = 'v1'
 
 // Score a pod has when we create it as a friend
-let FRIEND_BASE_SCORE = 100
+const FRIEND_SCORE = {
+  BASE: 100,
+  MAX: 1000
+}
 
 // Time to wait between requests to the friends (10 min)
 let INTERVAL = 600000
@@ -18,11 +21,11 @@ const PODS_SCORE = {
   BONUS: 10
 }
 
-// Number of retries we make for the make retry requests (to friends...)
-let REQUEST_RETRIES = 10
+// Number of requests in parallel we can make
+const REQUESTS_IN_PARALLEL = 10
 
-// Different types or requests for the request scheduler module
-const REQUEST_SCHEDULER_TYPE = [ 'add', 'remove' ]
+// Number of requests to retry for replay requests module
+const RETRY_REQUESTS = 5
 
 // Sortable columns per schema
 const SEARCHABLE_COLUMNS = {
@@ -48,27 +51,27 @@ const VIDEOS_CONSTRAINTS_FIELDS = {
   AUTHOR: { min: 3, max: 20 }, // Length
   TAGS: { min: 1, max: 3 }, // Number of total tags
   TAG: { min: 2, max: 10 }, // Length
-  THUMBNAIL: { min: 0, max: 20000 } // Bytes
+  THUMBNAIL: { min: 2, max: 30 },
+  THUMBNAIL64: { min: 0, max: 20000 } // Bytes
 }
 
 // Special constants for a test instance
 if (isTestInstance() === true) {
-  FRIEND_BASE_SCORE = 20
+  FRIEND_SCORE.BASE = 20
   INTERVAL = 10000
   VIDEOS_CONSTRAINTS_FIELDS.DURATION.max = 14
-  REQUEST_RETRIES = 2
 }
 
 // ---------------------------------------------------------------------------
 
 module.exports = {
   API_VERSION: API_VERSION,
-  FRIEND_BASE_SCORE: FRIEND_BASE_SCORE,
+  FRIEND_SCORE: FRIEND_SCORE,
   INTERVAL: INTERVAL,
   PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT,
   PODS_SCORE: PODS_SCORE,
-  REQUEST_RETRIES: REQUEST_RETRIES,
-  REQUEST_SCHEDULER_TYPE: REQUEST_SCHEDULER_TYPE,
+  REQUESTS_IN_PARALLEL: REQUESTS_IN_PARALLEL,
+  RETRY_REQUESTS: RETRY_REQUESTS,
   SEARCHABLE_COLUMNS: SEARCHABLE_COLUMNS,
   SORTABLE_COLUMNS: SORTABLE_COLUMNS,
   THUMBNAILS_SIZE: THUMBNAILS_SIZE,