1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add tests to handle down server

This commit is contained in:
Chocobozzz 2018-01-11 11:40:18 +01:00
parent 85cd9bde5a
commit 7bc2917145
No known key found for this signature in database
GPG key ID: 583A612D890159BE
12 changed files with 161 additions and 34 deletions

View file

@ -23,7 +23,9 @@ async function processAccept (actor: ActorModel, targetActor: ActorModel) {
const follow = await ActorFollowModel.loadByActorAndTarget(actor.id, targetActor.id)
if (!follow) throw new Error('Cannot find associated follow.')
follow.set('state', 'accepted')
await follow.save()
await addFetchOutboxJob(targetActor, undefined)
if (follow.state !== 'accepted') {
follow.set('state', 'accepted')
await follow.save()
await addFetchOutboxJob(targetActor, undefined)
}
}