]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/redundancy.ts
Fix avatar update
[github/Chocobozzz/PeerTube.git] / server / lib / redundancy.ts
index 16b1226585d76f277a65be40001c3f29ef497fed..04d3ded8fabec8b0bf0f0b171c01257875510744 100644 (file)
@@ -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
 }