X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fredundancy.ts;h=04d3ded8fabec8b0bf0f0b171c01257875510744;hb=ecf3f060ef8e40846ee41c9dcdf288065f4c461d;hp=16b1226585d76f277a65be40001c3f29ef497fed;hpb=e5565833f62b97f62ea75eba5b479963ae78b873;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/redundancy.ts b/server/lib/redundancy.ts index 16b122658..04d3ded8f 100644 --- a/server/lib/redundancy.ts +++ b/server/lib/redundancy.ts @@ -12,8 +12,17 @@ async function removeVideoRedundancy (videoRedundancy: VideoRedundancyModel, t?: await videoRedundancy.destroy({ transaction: t }) } +async function removeRedundancyOf (serverId: number) { + const videosRedundancy = await VideoRedundancyModel.listLocalOfServer(serverId) + + for (const redundancy of videosRedundancy) { + await removeVideoRedundancy(redundancy) + } +} + // --------------------------------------------------------------------------- export { + removeRedundancyOf, removeVideoRedundancy }