mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 10:58:38 +08:00
BUGFIX: use a more widely compatible version of sadd
This commit is contained in:
parent
7122fe0eed
commit
aa577f11fd
1 changed files with 4 additions and 1 deletions
|
@ -41,7 +41,10 @@ class CommonPasswords
|
||||||
|
|
||||||
def self.load_passwords
|
def self.load_passwords
|
||||||
passwords = File.readlines(PASSWORD_FILE)
|
passwords = File.readlines(PASSWORD_FILE)
|
||||||
redis.sadd LIST_KEY, passwords[0,5000].map!(&:chomp)
|
passwords[0,5000].map!(&:chomp).each do |pwd|
|
||||||
|
# slower, but a tad more compatible
|
||||||
|
redis.sadd LIST_KEY, pwd
|
||||||
|
end
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
# tolerate this so we don't block signups
|
# tolerate this so we don't block signups
|
||||||
Rails.logger.error "Common passwords file #{PASSWORD_FILE} is not found! Common password checking is skipped."
|
Rails.logger.error "Common passwords file #{PASSWORD_FILE} is not found! Common password checking is skipped."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue