aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-11 17:33:36 +0200
committerChocobozzz <me@florianbigard.com>2019-04-12 08:31:06 +0200
commitcda03765fe366f028897e9b02dd4a0a19af3c935 (patch)
tree4d30303d76f8fd171195a51b1f737a0067987d6c /server/initializers
parent7b293f28686319242958dff7315cdd8ad74fc15e (diff)
downloadPeerTube-cda03765fe366f028897e9b02dd4a0a19af3c935.tar.gz
PeerTube-cda03765fe366f028897e9b02dd4a0a19af3c935.tar.zst
PeerTube-cda03765fe366f028897e9b02dd4a0a19af3c935.zip
Add ability to delete old remote views
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/checker-before-init.ts3
-rw-r--r--server/initializers/config.ts7
-rw-r--r--server/initializers/constants.ts2
3 files changed, 11 insertions, 1 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts
index 6b43debfb..223ef8078 100644
--- a/server/initializers/checker-before-init.ts
+++ b/server/initializers/checker-before-init.ts
@@ -26,7 +26,8 @@ function checkMissedConfig () {
26 'instance.is_nsfw', 'instance.default_nsfw_policy', 'instance.robots', 'instance.securitytxt', 26 'instance.is_nsfw', 'instance.default_nsfw_policy', 'instance.robots', 'instance.securitytxt',
27 'services.twitter.username', 'services.twitter.whitelisted', 27 'services.twitter.username', 'services.twitter.whitelisted',
28 'followers.instance.enabled', 'followers.instance.manual_approval', 28 'followers.instance.enabled', 'followers.instance.manual_approval',
29 'tracker.enabled', 'tracker.private', 'tracker.reject_too_many_announces' 29 'tracker.enabled', 'tracker.private', 'tracker.reject_too_many_announces',
30 'history.videos.max_age', 'views.videos.remote.max_age'
30 ] 31 ]
31 const requiredAlternatives = [ 32 const requiredAlternatives = [
32 [ // set 33 [ // set
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 1f374dea9..baf502305 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -99,6 +99,13 @@ const CONFIG = {
99 MAX_AGE: parseDurationToMs(config.get('history.videos.max_age')) 99 MAX_AGE: parseDurationToMs(config.get('history.videos.max_age'))
100 } 100 }
101 }, 101 },
102 VIEWS: {
103 VIDEOS: {
104 REMOTE: {
105 MAX_AGE: parseDurationToMs(config.get('views.videos.remote.max_age'))
106 }
107 }
108 },
102 ADMIN: { 109 ADMIN: {
103 get EMAIL () { return config.get<string>('admin.email') } 110 get EMAIL () { return config.get<string>('admin.email') }
104 }, 111 },
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index f008cd291..8f6ef1a81 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -163,6 +163,7 @@ const SCHEDULER_INTERVALS_MS = {
163 removeOldJobs: 60000 * 60, // 1 hour 163 removeOldJobs: 60000 * 60, // 1 hour
164 updateVideos: 60000, // 1 minute 164 updateVideos: 60000, // 1 minute
165 youtubeDLUpdate: 60000 * 60 * 24, // 1 day 165 youtubeDLUpdate: 60000 * 60 * 24, // 1 day
166 removeOldViews: 60000 * 60 * 24, // 1 day
166 removeOldHistory: 60000 * 60 * 24 // 1 day 167 removeOldHistory: 60000 * 60 * 24 // 1 day
167} 168}
168 169
@@ -592,6 +593,7 @@ if (isTestInstance() === true) {
592 SCHEDULER_INTERVALS_MS.actorFollowScores = 1000 593 SCHEDULER_INTERVALS_MS.actorFollowScores = 1000
593 SCHEDULER_INTERVALS_MS.removeOldJobs = 10000 594 SCHEDULER_INTERVALS_MS.removeOldJobs = 10000
594 SCHEDULER_INTERVALS_MS.removeOldHistory = 5000 595 SCHEDULER_INTERVALS_MS.removeOldHistory = 5000
596 SCHEDULER_INTERVALS_MS.removeOldViews = 5000
595 SCHEDULER_INTERVALS_MS.updateVideos = 5000 597 SCHEDULER_INTERVALS_MS.updateVideos = 5000
596 REPEAT_JOBS[ 'videos-views' ] = { every: 5000 } 598 REPEAT_JOBS[ 'videos-views' ] = { every: 5000 }
597 599