]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Fix video action dropdown
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index a0609d7cde4aa95d64f77fe7139308e94c59dc5c..b5f8fc0bc751919ed71275d362fae7f570b9de75 100644 (file)
@@ -14,7 +14,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 360
+const LAST_MIGRATION_VERSION = 380
 
 // ---------------------------------------------------------------------------
 
@@ -158,12 +158,13 @@ const JOB_REQUEST_TIMEOUT = 3000 // 3 seconds
 const JOB_COMPLETED_LIFETIME = 60000 * 60 * 24 * 2 // 2 days
 const VIDEO_IMPORT_TIMEOUT = 1000 * 3600 // 1 hour
 
-// 1 hour
-let SCHEDULER_INTERVALS_MS = {
+const SCHEDULER_INTERVALS_MS = {
   actorFollowScores: 60000 * 60, // 1 hour
   removeOldJobs: 60000 * 60, // 1 hour
   updateVideos: 60000, // 1 minute
-  youtubeDLUpdate: 60000 * 60 * 24 // 1 day
+  youtubeDLUpdate: 60000 * 60 * 24, // 1 day
+  removeOldViews: 60000 * 60 * 24, // 1 day
+  removeOldHistory: 60000 * 60 * 24 // 1 day
 }
 
 // ---------------------------------------------------------------------------
@@ -280,12 +281,12 @@ let CONSTRAINTS_FIELDS = {
 
 const RATES_LIMIT = {
   LOGIN: {
-    WINDOW_MS: 5 * 60 * 1000, // 5 minutes
-    MAX: 15 // 15 attempts
+    WINDOW_MS: CONFIG.RATES_LIMIT.LOGIN.WINDOW_MS,
+    MAX: CONFIG.RATES_LIMIT.LOGIN.MAX
   },
   ASK_SEND_EMAIL: {
-    WINDOW_MS: 5 * 60 * 1000, // 5 minutes
-    MAX: 3 // 3 attempts
+    WINDOW_MS: CONFIG.RATES_LIMIT.ASK_SEND_EMAIL.WINDOW_MS,
+    MAX: CONFIG.RATES_LIMIT.ASK_SEND_EMAIL.MAX
   }
 }
 
@@ -591,6 +592,8 @@ if (isTestInstance() === true) {
 
   SCHEDULER_INTERVALS_MS.actorFollowScores = 1000
   SCHEDULER_INTERVALS_MS.removeOldJobs = 10000
+  SCHEDULER_INTERVALS_MS.removeOldHistory = 5000
+  SCHEDULER_INTERVALS_MS.removeOldViews = 5000
   SCHEDULER_INTERVALS_MS.updateVideos = 5000
   REPEAT_JOBS[ 'videos-views' ] = { every: 5000 }
 
@@ -734,7 +737,7 @@ function buildVideosExtname () {
 }
 
 function loadLanguages () {
-  VIDEO_LANGUAGES = buildLanguages()
+  Object.assign(VIDEO_LANGUAGES, buildLanguages())
 }
 
 function buildLanguages () {
@@ -775,6 +778,7 @@ function buildLanguages () {
 
   // Override Occitan label
   languages[ 'oc' ] = 'Occitan'
+  languages[ 'el' ] = 'Greek'
 
   return languages
 }