We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d2c23a commit 4de77f6Copy full SHA for 4de77f6
core/lib.rs
@@ -1190,22 +1190,8 @@ unsafe impl Sync for Connection {}
1190
1191
impl Drop for Connection {
1192
fn drop(&mut self) {
1193
- if !self.is_closed() {
1194
- // if connection wasn't properly closed, decrement the connection counter
1195
- if self
1196
- .db
1197
- .n_connections
1198
- .fetch_sub(1, std::sync::atomic::Ordering::SeqCst)
1199
- .eq(&1)
1200
- {
1201
- if let Err(e) = self
1202
- .pager
1203
- .load()
1204
- .checkpoint_shutdown(self.is_wal_auto_checkpoint_disabled())
1205
1206
- tracing::error!("Error during WAL checkpoint on connection drop: {}", e);
1207
- }
1208
+ if let Err(e) = self.close() {
+ tracing::error!("Error closing connection: {}", e);
1209
}
1210
1211
0 commit comments