From 79bf7fc597aa71419ffcf74f863225b7d12d82a6 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Mon, 19 Jul 2021 16:46:59 +0200 Subject: [PATCH] some logging shuffling --- src/database/abstraction/sqlite.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/database/abstraction/sqlite.rs b/src/database/abstraction/sqlite.rs index e4acdbb5..14306e19 100644 --- a/src/database/abstraction/sqlite.rs +++ b/src/database/abstraction/sqlite.rs @@ -150,11 +150,16 @@ impl Pool { } } + log::debug!("read_lock: All permanent readers locked, obtaining spillover reader..."); + // We didn't get a connection from the permanent pool, so we'll dumpster-dive for recycled connections. // Either we have a connection or we dont, if we don't, we make a new one. let conn = match self.spills.try_take() { Some(conn) => conn, - None => Self::prepare_conn(&self.path, None).unwrap(), + None => { + log::debug!("read_lock: No recycled connections left, creating new one..."); + Self::prepare_conn(&self.path, None).unwrap() + } }; // Clone the spill Arc to mark how many spilled connections actually exist. @@ -163,8 +168,6 @@ impl Pool { // Get a sense of how many connections exist now. let now_count = Arc::strong_count(&spill_arc) - 1 /* because one is held by the pool */; - log::debug!("read_lock: all readers locked, creating spillover reader..."); - // If the spillover readers are more than the number of total readers, there might be a problem. if now_count > self.readers.len() { log::warn!(