mirror of
https://github.com/discourse/discourse.git
synced 2025-05-26 12:05:25 +08:00

* Updates GitHub Action for migrations * Rubocop: Always `EnforcedShorthandSyntax` for hashes in the `migrations` directory * Automatically load all available converter steps * Enable YJIT at runtime, if available * Progressbar shows skipped records and other small improvements
18 lines
378 B
Ruby
18 lines
378 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Migrations
|
|
module DateHelper
|
|
def self.human_readable_time(seconds)
|
|
hours, remainder = seconds.divmod(3600)
|
|
minutes, seconds = remainder.divmod(60)
|
|
format("%02d:%02d:%02d", hours, minutes, seconds)
|
|
end
|
|
|
|
def self.track_time
|
|
start_time = Time.now
|
|
yield
|
|
Time.now - start_time
|
|
end
|
|
end
|
|
end
|