diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 11:33:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 13:45:39 +0200 |
commit | 6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0 (patch) | |
tree | b47de7efb8c6c611c63a15a971c6125a278f547a /server/lib/schedulers | |
parent | 2c3abc4fa796555eb7d25f416c4f41ab3e3ad8ca (diff) | |
download | PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.gz PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.tar.zst PeerTube-6dd9de95dfa39bd5c1faed00d1dbd52cd112bae0.zip |
Move config in its own file
Diffstat (limited to 'server/lib/schedulers')
-rw-r--r-- | server/lib/schedulers/videos-redundancy-scheduler.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 1a48f2bd0..4a8a1d413 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { AbstractScheduler } from './abstract-scheduler' | 1 | import { AbstractScheduler } from './abstract-scheduler' |
2 | import { CONFIG, HLS_REDUNDANCY_DIRECTORY, REDUNDANCY, VIDEO_IMPORT_TIMEOUT } from '../../initializers' | 2 | import { HLS_REDUNDANCY_DIRECTORY, REDUNDANCY, VIDEO_IMPORT_TIMEOUT, WEBSERVER } from '../../initializers' |
3 | import { logger } from '../../helpers/logger' | 3 | import { logger } from '../../helpers/logger' |
4 | import { VideosRedundancy } from '../../../shared/models/redundancy' | 4 | import { VideosRedundancy } from '../../../shared/models/redundancy' |
5 | import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' | 5 | import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' |
@@ -15,6 +15,7 @@ import { getOrCreateVideoAndAccountAndChannel } from '../activitypub' | |||
15 | import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' | 15 | import { VideoStreamingPlaylistModel } from '../../models/video/video-streaming-playlist' |
16 | import { VideoModel } from '../../models/video/video' | 16 | import { VideoModel } from '../../models/video/video' |
17 | import { downloadPlaylistSegments } from '../hls' | 17 | import { downloadPlaylistSegments } from '../hls' |
18 | import { CONFIG } from '../../initializers/config' | ||
18 | 19 | ||
19 | type CandidateToDuplicate = { | 20 | type CandidateToDuplicate = { |
20 | redundancy: VideosRedundancy, | 21 | redundancy: VideosRedundancy, |
@@ -186,7 +187,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
186 | const createdModel = await VideoRedundancyModel.create({ | 187 | const createdModel = await VideoRedundancyModel.create({ |
187 | expiresOn: this.buildNewExpiration(redundancy.minLifetime), | 188 | expiresOn: this.buildNewExpiration(redundancy.minLifetime), |
188 | url: getVideoCacheFileActivityPubUrl(file), | 189 | url: getVideoCacheFileActivityPubUrl(file), |
189 | fileUrl: video.getVideoRedundancyUrl(file, CONFIG.WEBSERVER.URL), | 190 | fileUrl: video.getVideoRedundancyUrl(file, WEBSERVER.URL), |
190 | strategy: redundancy.strategy, | 191 | strategy: redundancy.strategy, |
191 | videoFileId: file.id, | 192 | videoFileId: file.id, |
192 | actorId: serverActor.id | 193 | actorId: serverActor.id |
@@ -212,7 +213,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
212 | const createdModel = await VideoRedundancyModel.create({ | 213 | const createdModel = await VideoRedundancyModel.create({ |
213 | expiresOn: this.buildNewExpiration(redundancy.minLifetime), | 214 | expiresOn: this.buildNewExpiration(redundancy.minLifetime), |
214 | url: getVideoCacheStreamingPlaylistActivityPubUrl(video, playlist), | 215 | url: getVideoCacheStreamingPlaylistActivityPubUrl(video, playlist), |
215 | fileUrl: playlist.getVideoRedundancyUrl(CONFIG.WEBSERVER.URL), | 216 | fileUrl: playlist.getVideoRedundancyUrl(WEBSERVER.URL), |
216 | strategy: redundancy.strategy, | 217 | strategy: redundancy.strategy, |
217 | videoStreamingPlaylistId: playlist.id, | 218 | videoStreamingPlaylistId: playlist.id, |
218 | actorId: serverActor.id | 219 | actorId: serverActor.id |