Skip to content

Commit f25a15d

Browse files
shutdown logs
1 parent e5ef2a7 commit f25a15d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/pg_lsp/src/db_connection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl DbConnection {
6565
connection_string == self.connection_string
6666
}
6767

68+
#[tracing::instrument(name = "Closing DB Pool", skip(self))]
6869
pub(crate) async fn close(self) {
6970
let _ = self.close_tx.send(());
7071
let _ = self.schema_update_handle.await;

crates/pg_lsp/src/server.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,16 @@ impl LanguageServer for LspServer {
227227

228228
#[tracing::instrument(name = "shutdown", skip(self))]
229229
async fn shutdown(&self) -> jsonrpc::Result<()> {
230-
tracing::info!("Shutting down session...");
231230
self.session.shutdown().await;
232-
233-
tracing::info!("Shutting down debouncer...");
234231
self.debouncer.shutdown().await;
235232

236233
self.client
237-
.log_message(MessageType::INFO, "Postgres LSP terminated.")
234+
.send_notification::<ShowMessage>(ShowMessageParams {
235+
message: "Shutdown successful.".into(),
236+
typ: MessageType::INFO,
237+
})
238238
.await;
239239

240-
tracing::info!("Shutdown successful.");
241-
242240
Ok(())
243241
}
244242

crates/pg_lsp/src/session.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ impl Session {
2828
}
2929
}
3030

31+
#[tracing::instrument(name = "Shutting down Session", skip(self))]
3132
pub async fn shutdown(&self) {
3233
let mut db = self.db.write().await;
3334
let db = db.take();

0 commit comments

Comments
 (0)