]> cat aescling's git repositories - mastodon.git/commitdiff
Simplify culling and fix race condition (#10440)
authorJeong Arm <kjwonmail@gmail.com>
Mon, 1 Apr 2019 17:17:21 +0000 (02:17 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 1 Apr 2019 17:17:21 +0000 (19:17 +0200)
lib/mastodon/accounts_cli.rb

index dca31cdca3e7bf4840ddb955662de4b0c578e8bd..f02b2149b7f4a974a82eaa736461ea931cd01de3 100644 (file)
@@ -236,11 +236,7 @@ module Mastodon
         end
 
         if [404, 410].include?(code)
-          unless options[:dry_run]
-            SuspendAccountService.new.call(account)
-            account.destroy
-          end
-
+          SuspendAccountService.new.call(account, destroy: true) unless options[:dry_run]
           culled += 1
           say('+', :green, false)
         else