mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-25 00:29:30 -05:00
16 lines
393 B
Ruby
16 lines
393 B
Ruby
|
module Jobs
|
||
|
|
||
|
class CalculateAvgTime < Jobs::Scheduled
|
||
|
every 1.day
|
||
|
|
||
|
# PERF: these calculations can become exceedingly expnsive
|
||
|
# they run a huge gemoetric mean and are hard to optimise
|
||
|
# defer to only run once a day
|
||
|
def execute(args)
|
||
|
# Update the average times
|
||
|
Post.calculate_avg_time(2.days.ago)
|
||
|
Topic.calculate_avg_time(2.days.ago)
|
||
|
end
|
||
|
end
|
||
|
end
|