Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MET-6235 Remove needless debias polling #869

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,12 @@ export class DatasetInfoComponent extends SubscriptionManager {
})
);
} else {
this.cmpDebias.startPolling();
this.subs.push(this.modalConfirms.open(this.modalIdPrefix + this.modalIdDebias).subscribe());
const pollerId = this.cmpDebias.startPolling();
this.subs.push(
this.modalConfirms.open(this.modalIdPrefix + this.modalIdDebias).subscribe(() => {
console.log(this.cmpDebias.clearDataPollerByIdentifier(pollerId));
})
);
}
}
}
3 changes: 2 additions & 1 deletion projects/sandbox/src/app/debias/debias.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ describe('DebiasComponent', () => {
it('should poll the debias report', fakeAsync(() => {
expect(component.debiasReport).toBeFalsy();
component.datasetId = DebiasState.COMPLETED;
component.startPolling();
const pollerId = component.startPolling();
expect(pollerId).toBeTruthy();
tick(component.apiSettings.interval);
expect(component.debiasReport).toBeTruthy();
tick(component.apiSettings.interval);
Expand Down
3 changes: 2 additions & 1 deletion projects/sandbox/src/app/debias/debias.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class DebiasComponent extends DataPollingComponent {
/** startPolling
* begins the data poller for the debias data
**/
startPolling(): void {
startPolling(): string {
const pollerId = this.datasetId + '-debias-' + new Date().toISOString();

this.createNewDataPoller(
Expand All @@ -82,6 +82,7 @@ export class DebiasComponent extends DataPollingComponent {
},
pollerId
);
return pollerId;
}

/** closeDebiasInfo
Expand Down