From 90d4bb8125e80c8060416d4d135ddeaf0a622ede Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 13 Jun 2018 14:27:40 +0200 Subject: Refractor retry transaction function --- server/lib/activitypub/actor.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'server/lib/activitypub/actor.ts') 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 } } - const options = { - arguments: [ result, ownerActor ], - errorMessage: 'Cannot save actor and server with many retries.' - } - actor = await retryTransactionWrapper(saveActorAndServerAndModelIfNotExist, options) + actor = await retryTransactionWrapper(saveActorAndServerAndModelIfNotExist, result, ownerActor) } - const options = { - arguments: [ actor ], - errorMessage: 'Cannot refresh actor if needed with many retries.' - } - return retryTransactionWrapper(refreshActorIfNeeded, options) + return retryTransactionWrapper(refreshActorIfNeeded, actor) } function buildActorInstance (type: ActivityPubActorType, url: string, preferredUsername: string, uuid?: string) { -- cgit v1.2.3