From b3180861354fc3c692d42d9504c7a964b92fd4be Mon Sep 17 00:00:00 2001 From: Luke Baker Date: Thu, 18 Jul 2013 12:54:21 -0400 Subject: [PATCH] disable catchup on surveys with >= 1000 choices --- app/models/question.rb | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/app/models/question.rb b/app/models/question.rb index 51edc5b..b667a9f 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -510,6 +510,12 @@ class Question < ActiveRecord::Base end def add_prompt_to_queue + # if this question has 1000 or more choices disable catchup + if self.uses_catchup? && self.choices.count >= 1000 + self.uses_catchup = false + self.save + end + return unless self.uses_catchup? # if less than 90% full, regenerate prompts # we skip generating prompts if more than 90% full to # prevent one busy marketplace for ruling the queue -- libgit2 0.21.2