mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:29:30 +08:00
b3238bfc34
Now forums can enroll their sites to be showcased in the Discourse [Discover](https://discourse.org/discover) directory. Once they enable the site setting `include_in_discourse_discover` to enroll their forum the `CallDiscourseHub` job will ping the `api.discourse.org/api/discover/enroll` endpoint. Then the Discourse Hub will fetch the basic details from the forum and add it to the review queue. If the site is approved then the forum details will be displayed in the `/discover` page.
31 lines
800 B
Ruby
31 lines
800 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "benchmark"
|
|
|
|
desc "This task is called by the Heroku scheduler add-on"
|
|
|
|
task enqueue_digest_emails: :environment do
|
|
Jobs::EnqueueDigestEmails.new.execute(nil)
|
|
end
|
|
|
|
task category_stats: :environment do
|
|
Jobs::CategoryStats.new.execute(nil)
|
|
end
|
|
|
|
task periodical_updates: :environment do
|
|
Jobs::PeriodicalUpdates.new.execute(nil)
|
|
end
|
|
|
|
task version_check: :environment do
|
|
Jobs::CallDiscourseHub.new.execute(nil)
|
|
end
|
|
|
|
desc "run every task the scheduler knows about in that order, use only for debugging"
|
|
task "scheduler:run_all" => :environment do
|
|
MiniScheduler::Manager.discover_schedules.each do |schedule|
|
|
puts "Running #{schedule}"
|
|
elapsed = Benchmark.realtime { schedule.new.execute({}) }
|
|
puts "Elapsed #{(elapsed * 1000).to_i}ms"
|
|
end
|
|
end
|