diff --git a/extensions/sql-migration/src/models/stateMachine.ts b/extensions/sql-migration/src/models/stateMachine.ts index eeecc69642..6fe41d4f8d 100644 --- a/extensions/sql-migration/src/models/stateMachine.ts +++ b/extensions/sql-migration/src/models/stateMachine.ts @@ -659,7 +659,7 @@ export class MigrationStateModel implements Model, vscode.Disposable { void vscode.window.showInformationMessage(constants.AZURE_RECOMMENDATION_START_POPUP); - await this.startSkuTimers(page, this.refreshPerfDataCollectionFrequency); + await this.startSkuTimers(page); } } catch (error) { @@ -688,7 +688,7 @@ export class MigrationStateModel implements Model, vscode.Disposable { } } - public async startSkuTimers(page: SKURecommendationPage, refreshIntervalInMs: number): Promise { + public async startSkuTimers(page: SKURecommendationPage): Promise { const classVariable = this; if (!this._autoRefreshPerfDataCollectionHandle) { @@ -701,7 +701,7 @@ export class MigrationStateModel implements Model, vscode.Disposable { await page.refreshSkuRecommendationComponents(); // update timer } }, - refreshIntervalInMs); + this.refreshPerfDataCollectionFrequency); } } @@ -773,7 +773,7 @@ export class MigrationStateModel implements Model, vscode.Disposable { } } catch (error) { - logError(TelemetryViews.DataCollectionWizard, 'RefreshDataCollectionFailed', error); + console.log(error); // use console.log() instead of logError() to avoid spamming telemetry with this error, which can be frequent } return true; diff --git a/extensions/sql-migration/src/wizard/skuRecommendationPage.ts b/extensions/sql-migration/src/wizard/skuRecommendationPage.ts index 8f728b7aee..3913ecde96 100644 --- a/extensions/sql-migration/src/wizard/skuRecommendationPage.ts +++ b/extensions/sql-migration/src/wizard/skuRecommendationPage.ts @@ -556,12 +556,9 @@ export class SKURecommendationPage extends MigrationWizardPage { // check if collector is still running await this.migrationStateModel.refreshPerfDataCollection(); if (this.migrationStateModel._perfDataCollectionIsCollecting) { - // user started collecting data, and the collector is still running - const collectionStartTime = new Date(this.migrationStateModel._perfDataCollectionStartDate!); - const expectedRefreshTime = new Date(collectionStartTime.getTime() + this.migrationStateModel.refreshGetSkuRecommendationFrequency); - const timeLeft = Math.abs(new Date().getTime() - expectedRefreshTime.getTime()); - await this.migrationStateModel.startSkuTimers(this, timeLeft); - + // user started collecting data, ensure the collector is still running + await this.migrationStateModel.startSkuTimers(this); + await this.refreshSkuRecommendationComponents(); } else { // user started collecting data, but collector is stopped // set stop date to some date value