Commit 63fd49f68e134c67c50c11dcc6647092146bae4e
1 parent
21e15e23
Exists in
master
and in
1 other branch
change Stopped_Voting to Stopped_Voting_Or_Clicking
add docs for why we skip generating prompts if 90% full
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
app/models/question.rb
| ... | ... | @@ -477,6 +477,8 @@ class Question < ActiveRecord::Base |
| 477 | 477 | def add_prompt_to_queue |
| 478 | 478 | num_prompts = 1000 |
| 479 | 479 | # if less than 90% full, regenerate prompts |
| 480 | + # we skip generating prompts if more than 90% full to | |
| 481 | + # prevent one busy marketplace for ruling the queue | |
| 480 | 482 | if $redis.llen(self.pq_key) < num_prompts * 0.9 |
| 481 | 483 | prompts = self.catchup_choose_prompt(num_prompts) |
| 482 | 484 | # clear list |
| ... | ... | @@ -595,7 +597,7 @@ class Question < ActiveRecord::Base |
| 595 | 597 | action_appearances = Appearance.count(:conditions => |
| 596 | 598 | ["voter_id = ? AND question_id = ? AND answerable_type IS NOT ?", |
| 597 | 599 | a.voter_id, a.question_id, nil]) |
| 598 | - appearance_type = (action_appearances > 0) ? 'Stopped_Voting' : 'Bounce' | |
| 600 | + appearance_type = (action_appearances > 0) ? 'Stopped_Voting_Or_Clicking' : 'Bounce' | |
| 599 | 601 | csv << [ appearance_type, a.id, a.voter_id, a.question_id, a.prompt.left_choice.id, a.prompt.left_choice.data.strip, a.prompt.right_choice.id, a.prompt.right_choice.data.strip, a.prompt_id, 'NA', a.created_at, a.updated_at, 'NA', '', a.voter.identifier, 'TRUE'] |
| 600 | 602 | end |
| 601 | 603 | end | ... | ... |