DEV: Apply syntax_tree formatting to lib/*

This commit is contained in:
David Taylor
2023-01-09 12:10:19 +00:00
parent b0fda61a8e
commit 6417173082
507 changed files with 16550 additions and 12627 deletions

View File

@ -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