Skip to content

Commit

Permalink
close discussions on "approved" submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
pudge committed Jun 21, 2007
1 parent 74a38f5 commit 4bffe77
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Slash/DB/Static/MySQL/MySQL.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -184,15 +184,30 @@ sub updateArchivedDiscussions {
my $days_to_archive = getCurrentStatic('archive_delay'); my $days_to_archive = getCurrentStatic('archive_delay');
return 0 if !$days_to_archive; return 0 if !$days_to_archive;


# Close discussions. # Close old discussions
return $self->sqlUpdate( my $count = $self->sqlUpdate(
"discussions", "discussions",
{ type => 'archived' }, { type => 'archived' },
"TO_DAYS(NOW()) - TO_DAYS(ts) > $days_to_archive "TO_DAYS(NOW()) - TO_DAYS(ts) > $days_to_archive
AND type = 'open' AND type = 'open'
AND flags != 'delete' AND flags != 'delete'
AND archivable = 'yes'" AND archivable = 'yes'"
); );

# Close expired submission discussions
$count += $self->sqlUpdate(
"firehose, discussions",
{ 'firehose.type' => 'archived' },
"firehose.type = 'submission'
AND firehose.accepted = 'yes'
AND firehose.discussion IS NOT NULL
AND discussions.id = firehose.discussion
AND discussions.type = 'open'
AND discussions.flags != 'delete'
AND discussions.archivable = 'yes'"
);

return $count;
} }




Expand Down

0 comments on commit 4bffe77

Please sign in to comment.