We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc31e5c commit 52c889aCopy full SHA for 52c889a
1 file changed
app/workers/scheduler/ip_cleanup_scheduler.rb
@@ -9,7 +9,7 @@ class Scheduler::IpCleanupScheduler
9
10
def perform
11
time_ago = RETENTION_PERIOD.ago
12
- SessionActivation.where('updated_at < ?', time_ago).destroy_all
13
- User.where('last_sign_in_at < ?', time_ago).update_all(last_sign_in_ip: nil)
+ SessionActivation.where('updated_at < ?', time_ago).in_batches.destroy_all
+ User.where('last_sign_in_at < ?', time_ago).where.not(last_sign_in_ip: nil).in_batches.update_all(last_sign_in_ip: nil)
14
end
15
0 commit comments