Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix `redis.sadd` warnings (#23244)

Jarek Radosz09446baf1027
diff --git a/lib/common_passwords.rb b/lib/common_passwords.rb
index cd676ab78e9..72aad6c3c47 100644
--- a/lib/common_passwords.rb
+++ b/lib/common_passwords.rb
@@ -41,7 +41,7 @@ class CommonPasswords
def self.load_passwords
passwords = File.readlines(PASSWORD_FILE)
- redis.sadd LIST_KEY, passwords.map!(&:chomp)
+ 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."
diff --git a/spec/lib/backup_restore/system_interface_spec.rb b/spec/lib/backup_restore/system_interface_spec.rb
index e22b90daa6f..ffb4beab49c 100644
--- a/spec/lib/backup_restore/system_interface_spec.rb
+++ b/spec/lib/backup_restore/system_interface_spec.rb
@@ -132,7 +132,7 @@ RSpec.describe BackupRestore::SystemInterface do
key = "#{hostname}:#{pid}"
process = { pid: pid, hostname: hostname }
- conn.sadd("processes", key)
+ conn.sadd?("processes", key)
conn.hmset(key, "info", Sidekiq.dump_json(process))
data =