diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-02-22 18:18:29 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-22 18:18:29 -0600 |
commit | 19e7b163103b1a5dc97182aadf72c2753b98b5bf (patch) | |
tree | f7c735ee2f4563ab891425eaee13105b7f39e813 | |
parent | 4a069aded1672abddb6170e6abadcd3295db67c2 (diff) |
add missing `find_each`
-rw-r--r-- | app/workers/scheduler/defang_scheduler.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/workers/scheduler/defang_scheduler.rb b/app/workers/scheduler/defang_scheduler.rb index ea999572d..7476cc933 100644 --- a/app/workers/scheduler/defang_scheduler.rb +++ b/app/workers/scheduler/defang_scheduler.rb @@ -5,9 +5,10 @@ class Scheduler::DefangScheduler include ServiceAccountHelper def perform - User.where(defanged: false, last_fanged_at: nil).or(User.where('last_fanged_at <= ?', 15.minutes.ago)) do |user| + User.where(defanged: false, last_fanged_at: nil).or(User.where('last_fanged_at <= ?', 15.minutes.ago)).find_each do |user| user.defang! next unless user&.account.present? + service_dm('announcements', user.account, "You are no longer in #{user.role} mode.", footer: 'auto-defang') end end |