diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-17 11:28:08 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-17 11:28:33 +0200 |
commit | c07b6041111daa6dd5d611f31e31819db5992ba8 (patch) | |
tree | c4b0a64372b59e0d2beda7c5d0b1ff7426cfd734 | |
parent | 860cfb31e343f2317416da738f7155803ef4fe75 (diff) | |
download | PeerTube-c07b6041111daa6dd5d611f31e31819db5992ba8.tar.gz PeerTube-c07b6041111daa6dd5d611f31e31819db5992ba8.tar.zst PeerTube-c07b6041111daa6dd5d611f31e31819db5992ba8.zip |
Fix checker if we don't have redundancy strategies
-rw-r--r-- | config/test.yaml | 6 | ||||
-rw-r--r-- | server/initializers/checker.ts | 8 | ||||
-rw-r--r-- | server/initializers/constants.ts | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/config/test.yaml b/config/test.yaml index 517fc7449..16113211e 100644 --- a/config/test.yaml +++ b/config/test.yaml | |||
@@ -24,13 +24,13 @@ log: | |||
24 | redundancy: | 24 | redundancy: |
25 | videos: | 25 | videos: |
26 | - | 26 | - |
27 | size: '100KB' | 27 | size: '10MB' |
28 | strategy: 'most-views' | 28 | strategy: 'most-views' |
29 | - | 29 | - |
30 | size: '100KB' | 30 | size: '10MB' |
31 | strategy: 'trending' | 31 | strategy: 'trending' |
32 | - | 32 | - |
33 | size: '100KB' | 33 | size: '10MB' |
34 | strategy: 'recently-added' | 34 | strategy: 'recently-added' |
35 | minViews: 10 | 35 | minViews: 10 |
36 | 36 | ||
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts index 29f4f3036..b9dc1e725 100644 --- a/server/initializers/checker.ts +++ b/server/initializers/checker.ts | |||
@@ -52,11 +52,11 @@ function checkConfig () { | |||
52 | if (filtered.length !== redundancyVideos.length) { | 52 | if (filtered.length !== redundancyVideos.length) { |
53 | return 'Redundancy video entries should have unique strategies' | 53 | return 'Redundancy video entries should have unique strategies' |
54 | } | 54 | } |
55 | } | ||
56 | 55 | ||
57 | const recentlyAddedStrategy = redundancyVideos.find(r => r.strategy === 'recently-added') as RecentlyAddedStrategy | 56 | const recentlyAddedStrategy = redundancyVideos.find(r => r.strategy === 'recently-added') as RecentlyAddedStrategy |
58 | if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) { | 57 | if (recentlyAddedStrategy && isNaN(recentlyAddedStrategy.minViews)) { |
59 | return 'Min views in recently added strategy is not a number' | 58 | return 'Min views in recently added strategy is not a number' |
59 | } | ||
60 | } | 60 | } |
61 | 61 | ||
62 | return null | 62 | return null |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 02363352e..fa9093918 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -660,7 +660,7 @@ if (isTestInstance() === true) { | |||
660 | 660 | ||
661 | CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000 | 661 | CACHE.VIDEO_CAPTIONS.MAX_AGE = 3000 |
662 | MEMOIZE_TTL.OVERVIEWS_SAMPLE = 1 | 662 | MEMOIZE_TTL.OVERVIEWS_SAMPLE = 1 |
663 | ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0' | 663 | ROUTE_CACHE_LIFETIME.OVERVIEWS.VIDEOS = '0ms' |
664 | } | 664 | } |
665 | 665 | ||
666 | updateWebserverConfig() | 666 | updateWebserverConfig() |