mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 05:03:58 +08:00
PERF: Load all common passwords in one go (#15986)
Revert "BUGFIX: use a more widely compatible version of sadd"
This reverts commit aa577f11fd
.
I think the compatibility might not be a problem anymore, after 8 years? 😃
This commit is contained in:
parent
45cc16098d
commit
efb7e19325
|
@ -44,10 +44,7 @@ class CommonPasswords
|
|||
|
||||
def self.load_passwords
|
||||
passwords = File.readlines(PASSWORD_FILE)
|
||||
passwords.map!(&:chomp).each do |pwd|
|
||||
# slower, but a tad more compatible
|
||||
redis.sadd LIST_KEY, pwd
|
||||
end
|
||||
redis.sadd LIST_KEY, passwords.map!(&:chomp)
|
||||
rescue Errno::ENOENT
|
||||
# tolerate this so we don't block signups
|
||||
Rails.logger.error "Common passwords file #{PASSWORD_FILE} is not found! Common password checking is skipped."
|
||||
|
|
Loading…
Reference in New Issue
Block a user