mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 06:46:32 +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"
|
quick-xml = "0.27"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
regex = "1.7"
|
regex = "1.7"
|
||||||
rusqlite = { version = "0.28", features = ["sqlcipher"] }
|
rusqlite = { version = "0.28", features = ["sqlcipher", "release_memory"] }
|
||||||
rust-hsluv = "0.1"
|
rust-hsluv = "0.1"
|
||||||
sanitize-filename = "0.4"
|
sanitize-filename = "0.4"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ impl Drop for PooledConnection {
|
|||||||
// Put the connection back unless the pool is already dropped.
|
// Put the connection back unless the pool is already dropped.
|
||||||
if let Some(pool) = self.pool.upgrade() {
|
if let Some(pool) = self.pool.upgrade() {
|
||||||
if let Some(conn) = self.conn.take() {
|
if let Some(conn) = self.conn.take() {
|
||||||
|
conn.release_memory().ok();
|
||||||
pool.put(conn);
|
pool.put(conn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user