Every lock of the store goes through Db::conn
Db::conn is documented as the one way to take the lock, yet five production and test sites reached past it with db.0.lock(): the startup summary, the desktop's trash sweep and config_get, and tests in sharing and update. All five now call conn(). DRY pass #2, batch 2, F8 (#5372). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ pub fn config_get(db: State<'_, Db>) -> PublicConfig {
|
||||
// be enforced. A store error falls back to the default rather than failing the
|
||||
// call — the app must still boot.
|
||||
let fallback = retention::LOCAL_RETENTION_DAYS;
|
||||
let retention_days = match db.0.lock() {
|
||||
let retention_days = match db.conn() {
|
||||
Ok(conn) => state::effective_retention_days(&conn, fallback).unwrap_or(fallback),
|
||||
Err(_) => fallback,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user