Airblader commented on code in PR #18868:
URL: https://github.com/apache/flink/pull/18868#discussion_r868926310


##########
flink-runtime-web/web-dashboard/src/app/pages/job/checkpoints/job-checkpoints.component.ts:
##########
@@ -37,24 +40,52 @@ export class JobCheckpointsComponent implements OnInit {
 
   public moreDetailsPanel = { active: false, disabled: false };
 
-  constructor(private readonly jobService: JobService, private readonly cdr: 
ChangeDetectorRef) {}
+  private refresh$ = new Subject<void>();
+  private destroy$ = new Subject<void>();
+
+  constructor(
+    private readonly jobService: JobService,
+    private readonly jobLocalService: JobLocalService,
+    private readonly cdr: ChangeDetectorRef
+  ) {}
 
   public ngOnInit(): void {
-    this.jobService.jobDetail$.pipe(distinctUntilChanged((pre, next) => 
pre.jid === next.jid)).subscribe(data => {
-      this.jobDetail = data;
-      this.jobService.loadCheckpointStats(this.jobDetail.jid).subscribe(stats 
=> {
-        this.checkPointStats = stats;
+    this.jobLocalService
+      .jobDetailChanges()
+      .pipe(
+        distinctUntilChanged((pre, next) => pre.jid === next.jid),
+        takeUntil(this.destroy$)
+      )
+      .subscribe(data => {
+        this.jobDetail = data;
         this.cdr.markForCheck();
+        this.refresh$.next();
       });
-      
this.jobService.loadCheckpointConfig(this.jobDetail.jid).subscribe(config => {
+
+    this.refresh$
+      .pipe(
+        switchMap(() =>
+          forkJoin([
+            this.jobService.loadCheckpointStats(this.jobDetail.jid),
+            this.jobService.loadCheckpointConfig(this.jobDetail.jid)

Review Comment:
   We should add some `catchError` handling to these two requests, otherwise 
any request error will kill the entire refresh pipe.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to