Improve redundancy: add 'min_lifetime' configuration
[oweals/peertube.git] / server / lib / redundancy.ts
index 78221cc3d42e0c84e0ef753477d6a9602edbcdd1..16b1226585d76f277a65be40001c3f29ef497fed 100644 (file)
@@ -6,7 +6,8 @@ import { getServerActor } from '../helpers/utils'
 async function removeVideoRedundancy (videoRedundancy: VideoRedundancyModel, t?: Transaction) {
   const serverActor = await getServerActor()
 
-  await sendUndoCacheFile(serverActor, videoRedundancy, t)
+  // Local cache, send undo to remote instances
+  if (videoRedundancy.actorId === serverActor.id) await sendUndoCacheFile(serverActor, videoRedundancy, t)
 
   await videoRedundancy.destroy({ transaction: t })
 }