mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Require a min amount of reviewables before calculating thresholds
On forums with very few flags you don't want to calculate averages because they won't be very useful. Stick with the defaults until we hit 15 reviewables at least.
This commit is contained in:
@@ -3,7 +3,12 @@
|
||||
class Jobs::ReviewablePriorities < Jobs::Scheduled
|
||||
every 1.day
|
||||
|
||||
def self.min_reviewables
|
||||
15
|
||||
end
|
||||
|
||||
def execute(args)
|
||||
return unless Reviewable.where('score > 0').count >= self.class.min_reviewables
|
||||
|
||||
# We calculate the percentiles here for medium and high. Low is always 0 (all)
|
||||
res = DB.query_single(<<~SQL)
|
||||
|
||||
Reference in New Issue
Block a user