Fix typings
[oweals/peertube.git] / server / initializers / constants.ts
index c4e8522c297ad7ceca1d6711299eb4e576d65d5e..51d27289519652246b10e1ef0a0c623b55fcfa09 100644 (file)
@@ -30,7 +30,7 @@ const SORTABLE_COLUMNS = {
   JOBS: [ 'createdAt' ],
   VIDEO_ABUSES: [ 'id', 'createdAt' ],
   VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
-  VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ],
+  VIDEOS: [ 'name', 'duration', 'createdAt', 'publishedAt', 'views', 'likes' ],
   VIDEO_COMMENT_THREADS: [ 'createdAt' ],
   BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ],
   FOLLOWERS: [ 'createdAt' ],
@@ -42,6 +42,13 @@ const OAUTH_LIFETIME = {
   REFRESH_TOKEN: 1209600 // 2 weeks
 }
 
+const ROUTE_CACHE_LIFETIME = {
+  FEEDS: 1000 * 60 * 15, // 15 minutes
+  ACTIVITY_PUB: {
+    VIDEOS: 1000 // 1 second, cache concurrent requests after a broadcast for example
+  }
+}
+
 // ---------------------------------------------------------------------------
 
 // Number of points we add/remove after a successful/bad request
@@ -173,7 +180,8 @@ const CONFIG = {
     CUSTOMIZATIONS: {
       get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') },
       get CSS () { return config.get<string>('instance.customizations.css') }
-    }
+    },
+    get ROBOTS () { return config.get<string>('instance.robots') }
   },
   SERVICES: {
     TWITTER: {
@@ -413,8 +421,7 @@ const OPENGRAPH_AND_OEMBED_COMMENT = '<!-- open graph and oembed tags -->'
 // ---------------------------------------------------------------------------
 
 const FEEDS = {
-  COUNT: 20,
-  CACHE_LIFETIME: 1000 * 60 * 15 // 15 minutes
+  COUNT: 20
 }
 
 // ---------------------------------------------------------------------------
@@ -458,6 +465,7 @@ export {
   FOLLOW_STATES,
   SERVER_ACTOR_NAME,
   PRIVATE_RSA_KEY_SIZE,
+  ROUTE_CACHE_LIFETIME,
   SORTABLE_COLUMNS,
   FEEDS,
   NSFW_POLICY_TYPES,