const activityObject = activity.object
const actor = await getOrCreateActorAndServerAndModel(activity.actor)
- return processFollow(actor, activityObject)
+ return retryTransactionWrapper(processFollow, actor, activityObject)
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
-function processFollow (actor: ActorModel, targetActorURL: string) {
- const options = {
- arguments: [ actor, targetActorURL ],
- errorMessage: 'Cannot follow with many retries.'
- }
-
- return retryTransactionWrapper(follow, options)
-}
-
-async function follow (actor: ActorModel, targetActorURL: string) {
+async function processFollow (actor: ActorModel, targetActorURL: string) {
await sequelizeTypescript.transaction(async t => {
const targetActor = await ActorModel.loadByUrl(targetActorURL, t)