silence a log

Andrew Cantino %!s(int64=11) %!d(string=hace) años
padre
commit
9fb53c4f64
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      app/models/agents/human_task_agent.rb

+ 3 - 1
app/models/agents/human_task_agent.rb

@@ -169,7 +169,9 @@ module Agents
169 169
     def review_hits
170 170
       reviewable_hit_ids = RTurk::GetReviewableHITs.create.hit_ids
171 171
       my_reviewed_hit_ids = reviewable_hit_ids & (memory[:hits] || {}).keys.map(&:to_s)
172
-      log "MTurk reports #{reviewable_hit_ids.length} HITs, of which I own [#{my_reviewed_hit_ids.to_sentence}]"
172
+      if reviewable_hit_ids.length > 0
173
+        log "MTurk reports #{reviewable_hit_ids.length} HITs, of which I own [#{my_reviewed_hit_ids.to_sentence}]"
174
+      end
173 175
       my_reviewed_hit_ids.each do |hit_id|
174 176
         hit = RTurk::Hit.new(hit_id)
175 177
         assignments = hit.assignments