mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +03:00
sql: release memory when returning connection to the pool
This commit is contained in:
@@ -61,7 +61,7 @@ pretty_env_logger = { version = "0.4", optional = true }
|
||||
quick-xml = "0.27"
|
||||
rand = "0.8"
|
||||
regex = "1.7"
|
||||
rusqlite = { version = "0.28", features = ["sqlcipher"] }
|
||||
rusqlite = { version = "0.28", features = ["sqlcipher", "release_memory"] }
|
||||
rust-hsluv = "0.1"
|
||||
sanitize-filename = "0.4"
|
||||
serde_json = "1.0"
|
||||
|
||||
@@ -44,6 +44,7 @@ impl Drop for PooledConnection {
|
||||
// Put the connection back unless the pool is already dropped.
|
||||
if let Some(pool) = self.pool.upgrade() {
|
||||
if let Some(conn) = self.conn.take() {
|
||||
conn.release_memory().ok();
|
||||
pool.put(conn);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user