]> cat aescling's git repositories - mastodon.git/commitdiff
Fix Move handler not being triggered when failing to fetch target (#15107)
authorThibG <thib@sitedethib.com>
Mon, 9 Nov 2020 00:41:52 +0000 (01:41 +0100)
committerGitHub <noreply@github.com>
Mon, 9 Nov 2020 00:41:52 +0000 (01:41 +0100)
When failing to fetch the target account, the ProcessingWorker fails
as expected, but since it hasn't cleared the `move_in_progress` flag,
the next attempt at processing skips the `Move` activity altogether.

This commit changes it to clear the flag when encountering any
unexpected error on fetching the target account. This is likely to
occur because, of, e.g., a timeout, when many instances query the
same actor at the same time.

app/lib/activitypub/activity/move.rb

index 2103f503f20a6c97231f98a2b7c9128501361509..7e073f64d2309cdc212eafec7651a5cf6c34cf21 100644 (file)
@@ -20,6 +20,9 @@ class ActivityPub::Activity::Move < ActivityPub::Activity
 
     # Initiate a re-follow for each follower
     MoveWorker.perform_async(origin_account.id, target_account.id)
+  rescue
+    unmark_as_processing!
+    raise
   end
 
   private