Skip to content
Open
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 @@ -39,6 +39,7 @@ import {
getJvmMemorySliderConfig,
} from "../../../../common/util/computing-unit.util";
import { ComputingUnitActionsService } from "../../../../common/service/computing-unit/computing-unit-actions/computing-unit-actions.service";
import { interval } from "rxjs";

@UntilDestroy()
@Component({
Expand Down Expand Up @@ -145,6 +146,12 @@ export class UserComputingUnitComponent implements OnInit {
this.allComputingUnits = units;
this.entries = units.map(u => new DashboardEntry(u));
});

interval(1000)
.pipe(untilDestroyed(this))
.subscribe(() => {
this.computingUnitStatusService.refreshComputingUnitList();
});
Comment on lines +150 to +154
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make it event driven, instead of every second?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a better user experience to make it every second, so that the status is as fresh as possible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can deliver the same user experience. I am talking about implementation. can we make it event driven? for example, when some status changed, push an event to frontend to update the computing unit list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm mistaken, I don't think the existing services we have expose "messages" or events sent from the backend, they just expose functionality for refreshing all of the computing units. I think a timer based refreshing is most consistent with the functions we currently have.

}

terminateComputingUnit(cuid: number): void {
Expand Down
Loading