0
0
Fork 0

rubocop issues - Cleaning up (#8912)

* cleanup pass

* undo mistakes

* fixed.

* revert
This commit is contained in:
ashleyhull-versent 2018-10-08 13:50:11 +11:00 committed by Eugen Rochko
parent a00ce8c92c
commit f194857ac9
15 changed files with 33 additions and 33 deletions

View file

@ -342,8 +342,8 @@ module Mastodon
say "Migrating #{table_name}.#{column} (~#{total.to_i} rows)"
started_time = Time.now
last_time = Time.now
started_time = Time.zone.now
last_time = Time.zone.now
migrated = 0
loop do
stop_row = nil
@ -375,13 +375,13 @@ module Mastodon
end
migrated += batch_size
if Time.now - last_time > 1
if Time.zone.now - last_time > 1
status = "Migrated #{migrated} rows"
percentage = 100.0 * migrated / total
status += " (~#{sprintf('%.2f', percentage)}%, "
remaining_time = (100.0 - percentage) * (Time.now - started_time) / percentage
remaining_time = (100.0 - percentage) * (Time.zone.now - started_time) / percentage
status += "#{(remaining_time / 60).to_i}:"
status += sprintf('%02d', remaining_time.to_i % 60)
@ -397,7 +397,7 @@ module Mastodon
status += ')'
say status, true
last_time = Time.now
last_time = Time.zone.now
end
# There are no more rows left to update.