bit of cleanup

Andrew Cantino 9 years ago
parent
commit
dfb3cb99d7
2 changed files with 3 additions and 4 deletions
  1. 1 3
      app/models/agent.rb
  2. 2 1
      config/initializers/delayed_job.rb

+ 1 - 3
app/models/agent.rb

@@ -416,9 +416,7 @@ class Agent < ActiveRecord::Base
416 416
     # per type of agent, so you can override this to define custom bulk check behavior for your custom Agent type.
417 417
     def bulk_check(schedule)
418 418
       raise "Call #bulk_check on the appropriate subclass of Agent" if self == Agent
419
-      agent_ids = where("agents.schedule = ? and disabled = false", schedule).pluck("agents.id")
420
-      Rails.logger.info "Calling bulk_check(#{schedule}) on #{agent_ids}"
421
-      agent_ids.each do |agent_id|
419
+      where("agents.schedule = ? and disabled = false", schedule).pluck("agents.id").each do |agent_id|
422 420
         async_check(agent_id)
423 421
       end
424 422
     end

+ 2 - 1
config/initializers/delayed_job.rb

@@ -6,7 +6,8 @@ Delayed::Worker.default_priority = 10
6 6
 Delayed::Worker.delay_jobs = !Rails.env.test?
7 7
 Delayed::Worker.sleep_delay = (ENV['DELAYED_JOB_SLEEP_DELAY'].presence || 10).to_f
8 8
 
9
-Delayed::Worker.logger = Rails.logger
9
+# Delayed::Worker.logger = Logger.new(Rails.root.join('log', 'delayed_job.log'))
10
+# Delayed::Worker.logger.level = Logger::DEBUG
10 11
 
11 12
 class Delayed::Job
12 13
   scope :pending, ->{ where("locked_at IS NULL AND attempts = 0") }