mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FIX: DistributedMutex (#7953)
This commit is contained in:

committed by
GitHub

parent
3b575b82f3
commit
20bc4a38a5
@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'benchmark'
|
||||
|
||||
desc "This task is called by the Heroku scheduler add-on"
|
||||
|
||||
task enqueue_digest_emails: :environment do
|
||||
@ -18,16 +20,11 @@ task version_check: :environment do
|
||||
Jobs::VersionCheck.new.execute(nil)
|
||||
end
|
||||
|
||||
def time
|
||||
start = Time.now
|
||||
yield
|
||||
puts "Elapsed #{((Time.now - start) * 1000).to_i}ms"
|
||||
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}"
|
||||
time { schedule.new.execute({}) }
|
||||
elapsed = Benchmark.realtime { schedule.new.execute({}) }
|
||||
puts "Elapsed #{(elapsed * 1000).to_i}ms"
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user