fix(password): sync config, check equal

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2026-03-22 19:05:04 +08:00
parent 71be0dcd8d
commit fc9d521f0b
+3
View File
@@ -1573,6 +1573,9 @@ impl Config {
// This matches historical behavior, but may need revisiting in a separate PR. // This matches historical behavior, but may need revisiting in a separate PR.
pub fn set(cfg: Config) -> bool { pub fn set(cfg: Config) -> bool {
let mut lock = CONFIG.write().unwrap(); let mut lock = CONFIG.write().unwrap();
if *lock == cfg {
return false;
}
*lock = cfg; *lock = cfg;
lock.store(); lock.store();
// Drop CONFIG lock before acquiring KEY_PAIR lock to avoid potential deadlock. // Drop CONFIG lock before acquiring KEY_PAIR lock to avoid potential deadlock.