Commit b3180861354fc3c692d42d9504c7a964b92fd4be

Authored by Luke Baker
1 parent 554b592c

disable catchup on surveys with >= 1000 choices

Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
app/models/question.rb
... ... @@ -510,6 +510,12 @@ class Question < ActiveRecord::Base
510 510 end
511 511  
512 512 def add_prompt_to_queue
  513 + # if this question has 1000 or more choices disable catchup
  514 + if self.uses_catchup? && self.choices.count >= 1000
  515 + self.uses_catchup = false
  516 + self.save
  517 + end
  518 + return unless self.uses_catchup?
513 519 # if less than 90% full, regenerate prompts
514 520 # we skip generating prompts if more than 90% full to
515 521 # prevent one busy marketplace for ruling the queue
... ...