mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 17:23:21 -05:00
Only when the connection is connected, then do disconnect. (#5170)
This commit is contained in:
@@ -329,7 +329,13 @@ class SqlKernel extends Disposable implements nb.IKernel {
|
||||
|
||||
public async disconnect(): Promise<void> {
|
||||
if (this._path) {
|
||||
await this._connectionManagementService.disconnect(this._path);
|
||||
if (this._connectionManagementService.isConnected(this._path)) {
|
||||
try {
|
||||
await this._connectionManagementService.disconnect(this._path);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user