Handle disabled agents properly in bulk_check

Glenn 'devalias' Grant 11 years ago
parent
commit
2a407ca7e1
1 changed files with 1 additions and 2 deletions
  1. 1 2
      app/models/agent.rb

+ 1 - 2
app/models/agent.rb

@@ -317,8 +317,7 @@ class Agent < ActiveRecord::Base
317 317
     # per type of agent, so you can override this to define custom bulk check behavior for your custom Agent type.
318 318
     def bulk_check(schedule)
319 319
       raise "Call #bulk_check on the appropriate subclass of Agent" if self == Agent
320
-      where(:schedule => schedule).pluck("agents.id", "agents.disabled").each do |agent_id, agent_disabled|
321
-        return if agent_disabled
320
+      where("agents.schedule = ? and disabled = false", schedule).pluck("agents.id").each do |agent_id|
322 321
         async_check(agent_id)
323 322
       end
324 323
     end