Fix checker if we don't have redundancy strategies

pull/1082/head
Chocobozzz 2018-09-17 11:28:08 +02:00
parent 860cfb31e3
commit c07b604111
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 8 additions and 8 deletions

View File

@ -24,13 +24,13 @@ log:
redundancy:
videos:
-
size: '100KB'
size: '10MB'
strategy: 'most-views'
-
size: '100KB'
size: '10MB'
strategy: 'trending'
-
size: '100KB'
size: '10MB'
strategy: 'recently-added'
minViews: 10

View File

@ -52,11 +52,11 @@ function checkConfig () {
if (filtered.length !== redundancyVideos.length) {
return 'Redundancy video entries should have unique strategies'
}
}
const recentlyAddedStrategy = redundancyVideos.find(r => r.strategy === 'recently-added') as RecentlyAddedStrategy
if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) {
return 'Min views in recently added strategy is not a number'
const recentlyAddedStrategy = redundancyVideos.find(r => r.strategy === 'recently-added') as RecentlyAddedStrategy
if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) {
return 'Min views in recently added strategy is not a number'
}
}
return null

View File

@ -660,7 +660,7 @@ if (isTestInstance() === true) {
CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000
MEMOIZE_TTL.OVERVIEWS_SAMPLE = 1
ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0'
ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0ms'
}
updateWebserverConfig()