Skip to content

Commit

Permalink
Fix bug that would cause mod stats never to be written.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiemccarthy committed Aug 29, 2002
1 parent a98b42b commit f8451b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions themes/slashcode/tasks/run_moderatord.pl
Expand Up @@ -391,8 +391,9 @@ sub reconcile_stats {
my $consensus = $constants->{m2_consensus};
my $reasons = $slashdb->getReasons();
my @reasons_m2able =
sort grep { $reasons->{$_}{m2able} }
map { $reasons->{$_}{name} } keys %$reasons;
sort map { $reasons->{$_}{name} }
grep { $reasons->{$_}{m2able} }
keys %$reasons;
my $reason_name = $reasons->{$reason}{name};

# Update the stats. First create the rows if necessary.
Expand Down
6 changes: 3 additions & 3 deletions utils/createTestMetamods
Expand Up @@ -86,13 +86,13 @@ EOT

for (@{$comments}) {
# Our M2 vote starts off with a bias towards "fair".
my $unfair_frac = 0.15;
$unfair_frac = 0.50 if $reasons->{$_->{reason}}{val} == -1;
my $unfair_frac = 0.10;
$unfair_frac = 0.30 if $reasons->{$_->{reason}}{val} == -1;
# Some mods are more likely to be unfair than others.
# They are just bad mods. Don't hold it against them.
my $old_rand = rand(2**30);
srand($_->{id});
my $mod_bias = rand(2)*rand(2);
my $mod_bias = rand(3)*rand(3);
$unfair_frac *= $mod_bias;
# And some users are more likely to vote fair or unfair
# than others: about 10 percentage points (up or down)
Expand Down

0 comments on commit f8451b2

Please sign in to comment.