Update scrypt migration

This commit is contained in:
Ari Timonen 2020-04-06 05:52:39 +03:00
parent 4da3f38d25
commit 2628cfe10e

View file

@ -5,7 +5,7 @@ class UpdatePasswordsToScrypt < ActiveRecord::Migration[6.0]
def up
puts("SCRYPT_MAX_TIME=%s" % ENV['SCRYPT_MAX_TIME'])
puts("Migration takes about %0.0f seconds." % ENV['SCRYPT_MAX_TIME'].to_f*User.all.count)
puts("Migration takes about %0.0f seconds." % ENV['SCRYPT_MAX_TIME'].to_f*User.all.count*3)
SCrypt::Engine.calibrate!(max_time: ENV['SCRYPT_MAX_TIME'].to_f)
ActiveRecord::Base.transaction do
User.all.order(:id).each do |user|