diff options
author | Jason Robinson <mail@jasonrobinson.me> | 2015-05-12 21:55:59 +0300 |
---|---|---|
committer | Dennis Schubert <mail@dennis-schubert.de> | 2015-05-16 04:36:25 +0300 |
commit | aec2467e9895a4e70240274d1174f10218113d8d (patch) | |
tree | b6249ac5452bff29ba2135c38b108b7d6fed2c33 /app/workers | |
parent | 2668c487e7306233c42933db78a5afb52696ddd2 (diff) |
Fix inactive user removal not respecting configuration for daily limits
It seems ActiveRecord ignores .limit() if .find_each() is used to iterate the query (http://stackoverflow.com/a/6680541/1489738). Using .each() instead. Added a test.
closes #5953
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/queue_users_for_removal.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/queue_users_for_removal.rb b/app/workers/queue_users_for_removal.rb index 6d98837d6..b9565f7a8 100644 --- a/app/workers/queue_users_for_removal.rb +++ b/app/workers/queue_users_for_removal.rb @@ -22,7 +22,7 @@ module Workers # and queue accounts for closing to sidekiq # for those who have not signed in, skip warning and queue removal # in +1 days - users.find_each do |user| + users.each do |user| if user.sign_in_count > 0 remove_at = Time.now + AppConfig.settings.maintenance.remove_old_users.warn_days.to_i.days else @@ -38,4 +38,4 @@ module Workers end end end -end
\ No newline at end of file +end |