mengw15 commented on code in PR #8581:
URL: https://github.com/apache/texera/pull/8581#discussion_r4075490532
##########
frontend/src/app/workspace/component/menu/menu.component.ts:
##########
@@ -197,17 +197,14 @@ export class MenuComponent implements OnInit, OnDestroy {
private jupyterPanelService: JupyterPanelService,
private fileSaverService: FileSaverService
) {
- workflowWebsocketService
- .subscribeToEvent("ExecutionDurationUpdateEvent")
- .pipe(
- tap(event => (this.executionDuration = event.duration)),
- // restart the 1s timer on each event, only while running
- switchMap(event => (event.isRunning ? timer(1000, 1000) : EMPTY)),
- untilDestroyed(this)
- )
- .subscribe(() => {
- this.executionDuration += 1000;
- });
+ // From the service, not from the engine's event directly: that event
arrives twice in a whole
+ // run, so a timer hung off it never started for a menu that mounted in
between -- which is what
+ // a routed switch between the canvas and the Form View makes. The service
anchors the clock and
+ // ticks it, and replays the current value to whoever subscribes.
+ executeWorkflowService
+ .getExecutionDurationStream()
Review Comment:
One correction: `timer` is still unused in `workflow-form.component.ts` — it
now appears only inside the comments on lines 189 and 405. `EMPTY` (line 1880)
and `tap` are indeed still used there.
--
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]