2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-02-27 08:45:20 +08:00
|
|
|
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 Weekly < Jobs::Scheduled
|
|
|
|
every 1.week
|
|
|
|
|
|
|
|
def execute(args)
|
|
|
|
ScoreCalculator.new.calculate
|
2019-01-18 16:36:11 +08:00
|
|
|
MiniScheduler::Stat.purge_old
|
2015-06-02 11:45:47 +08:00
|
|
|
Draft.cleanup!
|
2017-02-01 06:21:37 +08:00
|
|
|
UserAuthToken.cleanup!
|
2019-08-21 16:23:20 +08:00
|
|
|
Upload.reset_unknown_extensions!
|
2014-02-27 08:45:20 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|