Skip to content

Commit 197ab99

Browse files
authored
Merge pull request #959 from alexet/fix-db-remove
Delete database after removing it from query server control.
2 parents b92d6ba + 6292adf commit 197ab99

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Add progress messages to LGTM download option. This makes the two-step process (selecting a project, then selecting a language) more clear. [#960](https://github.com/github/vscode-codeql/pull/960)
66
- Remove line about selecting a language from the dropdown when downloading database from LGTM. This makes the download progress visible when the popup is not expanded. [#957](https://github.com/github/vscode-codeql/pull/957)
77
- Fixed a bug where copying the version information fails when a CodeQL CLI cannot be found. [#958](https://github.com/github/vscode-codeql/pull/958)
8+
- Avoid a race condition when deleting databases that can cause occasional errors. [#959](https://github.com/github/vscode-codeql/pull/959)
89

910
## 1.5.5 - 08 September 2021
1011

extensions/ql-vscode/src/databases.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,9 @@ export class DatabaseManager extends DisposableObject {
811811
vscode.workspace.updateWorkspaceFolders(folderIndex, 1);
812812
}
813813

814+
// Remove this database item from the allow-list
815+
await this.deregisterDatabase(progress, token, item);
816+
814817
// Delete folder from file system only if it is controlled by the extension
815818
if (this.isExtensionControlledLocation(item.databaseUri)) {
816819
void logger.log('Deleting database from filesystem.');
@@ -819,9 +822,6 @@ export class DatabaseManager extends DisposableObject {
819822
e => void logger.log(`Failed to delete '${item.databaseUri.fsPath}'. Reason: ${e.message}`));
820823
}
821824

822-
// Remove this database item from the allow-list
823-
await this.deregisterDatabase(progress, token, item);
824-
825825
// note that we use undefined as the item in order to reset the entire tree
826826
this._onDidChangeDatabaseItem.fire({
827827
item: undefined,

0 commit comments

Comments
 (0)