From ee4188f917395b0d761ad780ce30c20fc0367c47 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Fri, 2 Jan 2026 13:07:58 +0000 Subject: [PATCH] Get read lock when retrieving general messages Now that the Database::general_messages() function takes &self instead of &mut self, the wrappers don't need to take a write lock to call it. --- cpp/src/database.rs | 2 +- nodejs/src/database.rs | 2 +- python/src/database.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/database.rs b/cpp/src/database.rs index 067e6b3d..4bdfaaea 100644 --- a/cpp/src/database.rs +++ b/cpp/src/database.rs @@ -116,7 +116,7 @@ impl Database { evaluate_conditions: bool, ) -> Result, VerboseError> { self.0 - .write() + .read() .map_err(DatabaseLockPoisonError::from)? .general_messages(to_eval_mode(evaluate_conditions)) .map(|v| v.into_iter().map(Into::into).collect()) diff --git a/nodejs/src/database.rs b/nodejs/src/database.rs index 2815fd92..55a6c818 100644 --- a/nodejs/src/database.rs +++ b/nodejs/src/database.rs @@ -153,7 +153,7 @@ impl Database { evaluate_conditions: EvalMode, ) -> Result, VerboseError> { self.0 - .write() + .read() .map_err(DatabaseLockPoisonError::from)? .general_messages(evaluate_conditions.into()) .map(|v| v.into_iter().map(Into::into).collect()) diff --git a/python/src/database.rs b/python/src/database.rs index ec1a8644..62bdde34 100644 --- a/python/src/database.rs +++ b/python/src/database.rs @@ -120,7 +120,7 @@ impl Database { evaluate_conditions: bool, ) -> Result, VerboseError> { self.0 - .write() + .read() .map_err(DatabaseLockPoisonError::from)? .general_messages(to_eval_mode(evaluate_conditions)) .map(|v| v.into_iter().map(Into::into).collect())