فهرست منبع

Handle disabled agents properly in bulk_check

Glenn 'devalias' Grant 11 سال پیش
والد
کامیت
2a407ca7e1
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      app/models/agent.rb

+ 1 - 2
app/models/agent.rb

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