]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/lib/redundancy.ts
Improve redundancy: add 'min_lifetime' configuration
[github/Chocobozzz/PeerTube.git] / server / lib / redundancy.ts
CommitLineData
c48e82b5
C
1import { VideoRedundancyModel } from '../models/redundancy/video-redundancy'
2import { sendUndoCacheFile } from './activitypub/send'
3import { Transaction } from 'sequelize'
4import { getServerActor } from '../helpers/utils'
5
6async function removeVideoRedundancy (videoRedundancy: VideoRedundancyModel, t?: Transaction) {
7 const serverActor = await getServerActor()
8
e5565833
C
9 // Local cache, send undo to remote instances
10 if (videoRedundancy.actorId === serverActor.id) await sendUndoCacheFile(serverActor, videoRedundancy, t)
c48e82b5
C
11
12 await videoRedundancy.destroy({ transaction: t })
13}
14
15// ---------------------------------------------------------------------------
16
17export {
18 removeVideoRedundancy
19}