0
0
Fork 0

Get rid of all batch order warnings (#8334)

This commit is contained in:
Eugen Rochko 2018-08-21 12:25:50 +02:00 committed by GitHub
parent 83746b6364
commit d98de8ada7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 19 additions and 19 deletions

View file

@ -9,7 +9,7 @@ class RefollowWorker
target_account = Account.find(target_account_id)
return unless target_account.protocol == :activitypub
target_account.followers.where(domain: nil).find_each do |follower|
target_account.followers.where(domain: nil).reorder(nil).find_each do |follower|
# Locally unfollow remote account
follower.unfollow!(target_account)

View file

@ -6,7 +6,7 @@ class Scheduler::BackupCleanupScheduler
sidekiq_options unique: :until_executed
def perform
old_backups.find_each(&:destroy!)
old_backups.reorder(nil).find_each(&:destroy!)
end
private

View file

@ -6,7 +6,7 @@ class Scheduler::EmailScheduler
sidekiq_options unique: :until_executed
def perform
eligible_users.find_each do |user|
eligible_users.reorder(nil).find_each do |user|
next unless user.allows_digest_emails?
DigestMailerWorker.perform_async(user.id)
end

View file

@ -6,7 +6,7 @@ class Scheduler::UserCleanupScheduler
sidekiq_options unique: :until_executed
def perform
User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).find_in_batches do |batch|
User.where('confirmed_at is NULL AND confirmation_sent_at <= ?', 2.days.ago).reorder(nil).find_in_batches do |batch|
Account.where(id: batch.map(&:account_id)).delete_all
User.where(id: batch.map(&:id)).delete_all
end