aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/actor.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-13 14:27:40 +0200
committerChocobozzz <me@florianbigard.com>2018-06-13 14:27:40 +0200
commit90d4bb8125e80c8060416d4d135ddeaf0a622ede (patch)
treeb3b7181329a08ecc930b54fe7b48095c4155393c /server/lib/activitypub/actor.ts
parent3cd0734fd9b0ff21aaef02317a874e8f1c06e027 (diff)
downloadPeerTube-90d4bb8125e80c8060416d4d135ddeaf0a622ede.tar.gz
PeerTube-90d4bb8125e80c8060416d4d135ddeaf0a622ede.tar.zst
PeerTube-90d4bb8125e80c8060416d4d135ddeaf0a622ede.zip
Refractor retry transaction function
Diffstat (limited to 'server/lib/activitypub/actor.ts')
-rw-r--r--server/lib/activitypub/actor.ts12
1 files changed, 2 insertions, 10 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index f27733418..9257d7d20 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -62,18 +62,10 @@ async function getOrCreateActorAndServerAndModel (activityActor: string | Activi
62 } 62 }
63 } 63 }
64 64
65 const options = { 65 actor = await retryTransactionWrapper(saveActorAndServerAndModelIfNotExist, result, ownerActor)
66 arguments: [ result, ownerActor ],
67 errorMessage: 'Cannot save actor and server with many retries.'
68 }
69 actor = await retryTransactionWrapper(saveActorAndServerAndModelIfNotExist, options)
70 } 66 }
71 67
72 const options = { 68 return retryTransactionWrapper(refreshActorIfNeeded, actor)
73 arguments: [ actor ],
74 errorMessage: 'Cannot refresh actor if needed with many retries.'
75 }
76 return retryTransactionWrapper(refreshActorIfNeeded, options)
77} 69}
78 70
79function buildActorInstance (type: ActivityPubActorType, url: string, preferredUsername: string, uuid?: string) { 71function buildActorInstance (type: ActivityPubActorType, url: string, preferredUsername: string, uuid?: string) {