diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-02 08:48:48 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-02 08:50:30 +0100 |
commit | 89613cb444b4e1601d202153d0ec8635392ec872 (patch) | |
tree | b8a5835253028f563ee9afbd2561032c94ec58b4 /server/lib/schedulers | |
parent | fb7b009d6368acacade236b74406709851a0eaa5 (diff) | |
download | PeerTube-89613cb444b4e1601d202153d0ec8635392ec872.tar.gz PeerTube-89613cb444b4e1601d202153d0ec8635392ec872.tar.zst PeerTube-89613cb444b4e1601d202153d0ec8635392ec872.zip |
Purge entire video from redundancy
Diffstat (limited to 'server/lib/schedulers')
-rw-r--r-- | server/lib/schedulers/videos-redundancy-scheduler.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 82005a2c8..93e76626c 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts | |||
@@ -301,7 +301,15 @@ export class VideosRedundancyScheduler extends AbstractScheduler { | |||
301 | const toDelete = await VideoRedundancyModel.loadOldestLocalExpired(redundancy.strategy, redundancy.minLifetime) | 301 | const toDelete = await VideoRedundancyModel.loadOldestLocalExpired(redundancy.strategy, redundancy.minLifetime) |
302 | if (!toDelete) return | 302 | if (!toDelete) return |
303 | 303 | ||
304 | await removeVideoRedundancy(toDelete) | 304 | const videoId = toDelete.VideoFile |
305 | ? toDelete.VideoFile.videoId | ||
306 | : toDelete.VideoStreamingPlaylist.videoId | ||
307 | |||
308 | const redundancies = await VideoRedundancyModel.listLocalByVideoId(videoId) | ||
309 | |||
310 | for (const redundancy of redundancies) { | ||
311 | await removeVideoRedundancy(redundancy) | ||
312 | } | ||
305 | } | 313 | } |
306 | } | 314 | } |
307 | 315 | ||