mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
DEV: Apply syntax_tree formatting to lib/*
This commit is contained in:
@ -12,9 +12,8 @@
|
||||
# Discourse.redis.without_namespace.del CommonPasswords::LIST_KEY
|
||||
|
||||
class CommonPasswords
|
||||
|
||||
PASSWORD_FILE = File.join(Rails.root, 'lib', 'common_passwords', '10-char-common-passwords.txt')
|
||||
LIST_KEY = 'discourse-common-passwords'
|
||||
PASSWORD_FILE = File.join(Rails.root, "lib", "common_passwords", "10-char-common-passwords.txt")
|
||||
LIST_KEY = "discourse-common-passwords"
|
||||
|
||||
@mutex = Mutex.new
|
||||
|
||||
@ -32,9 +31,7 @@ class CommonPasswords
|
||||
end
|
||||
|
||||
def self.password_list
|
||||
@mutex.synchronize do
|
||||
load_passwords unless redis.scard(LIST_KEY) > 0
|
||||
end
|
||||
@mutex.synchronize { load_passwords unless redis.scard(LIST_KEY) > 0 }
|
||||
RedisPasswordList.new
|
||||
end
|
||||
|
||||
@ -49,5 +46,4 @@ class CommonPasswords
|
||||
# tolerate this so we don't block signups
|
||||
Rails.logger.error "Common passwords file #{PASSWORD_FILE} is not found! Common password checking is skipped."
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user