Make trim cache not cancellable
This commit is contained in:
Родитель
e23d4a9d9f
Коммит
28bf345ea8
|
@ -678,20 +678,18 @@ export class DatabaseUI extends DisposableObject {
|
|||
|
||||
private async handleTrimCache(): Promise<void> {
|
||||
return withProgress(
|
||||
async (_progress, token) => {
|
||||
async () => {
|
||||
if (
|
||||
this.queryServer !== undefined &&
|
||||
this.databaseManager.currentDatabaseItem !== undefined
|
||||
) {
|
||||
await this.queryServer.trimCacheInDatabase(
|
||||
this.databaseManager.currentDatabaseItem,
|
||||
token,
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "Trimming cache",
|
||||
cancellable: true,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -112,10 +112,7 @@ export class QueryRunner {
|
|||
await this.qs.sendRequest(clearCache, params);
|
||||
}
|
||||
|
||||
async trimCacheInDatabase(
|
||||
dbItem: DatabaseItem,
|
||||
token: CancellationToken,
|
||||
): Promise<void> {
|
||||
async trimCacheInDatabase(dbItem: DatabaseItem): Promise<void> {
|
||||
if (dbItem.contents === undefined) {
|
||||
throw new Error("Can't trim the cache in an invalid database.");
|
||||
}
|
||||
|
@ -124,7 +121,7 @@ export class QueryRunner {
|
|||
const params: TrimCacheParams = {
|
||||
db,
|
||||
};
|
||||
await this.qs.sendRequest(trimCache, params, token);
|
||||
await this.qs.sendRequest(trimCache, params);
|
||||
}
|
||||
|
||||
public async compileAndRunQueryAgainstDatabaseCore(
|
||||
|
|
Загрузка…
Ссылка в новой задаче