diff --git a/app/jobs/scheduled/daily.rb b/app/jobs/scheduled/daily.rb new file mode 100644 index 000000000..d9e258a41 --- /dev/null +++ b/app/jobs/scheduled/daily.rb @@ -0,0 +1,19 @@ +require_dependency 'score_calculator' + +module Jobs + + # This job will run on a regular basis to update statistics and denormalized data. + # If it does not run, the site will not function properly. + class PeriodicalUpdates < Jobs::Scheduled + every 1.day + + def execute(args) + # TODO: optimise this against a big site before doing this any more + # frequently + # + # current implementation wipes an entire table and rebuilds causing huge + # amounts of IO + TopTopic.refresh! + end + end +end diff --git a/app/jobs/scheduled/periodical_updates.rb b/app/jobs/scheduled/periodical_updates.rb index af5f3cb15..8a297c9c6 100644 --- a/app/jobs/scheduled/periodical_updates.rb +++ b/app/jobs/scheduled/periodical_updates.rb @@ -21,8 +21,6 @@ module Jobs # Update the scores of posts ScoreCalculator.new.calculate - # Refresh Top Topics - TopTopic.refresh! # Automatically close stuff that we missed Topic.auto_close