Skip to content

Commit

Permalink
improve interactions when Funman times out (#5509)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
mwdchang and github-actions[bot] authored Nov 15, 2024
1 parent ef456d7 commit da98267
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import Button from 'primevue/button';
import { Poller, PollerState } from '@/api/api';
import { pollAction, getRunResult } from '@/services/models/simulation-service';
import { logger } from '@/utils/logger';
import { useToastService } from '@/services/toast';
import { Simulation } from '@/types/Types';
import { getModelConfigurationById } from '@/services/model-configurations';
Expand Down Expand Up @@ -60,8 +61,8 @@ const addOutputPorts = async (runId: string) => {
const getStatus = async (runId: string) => {
poller
.setInterval(5000)
.setThreshold(100)
.setInterval(6000)
.setThreshold(200)
.setPollAction(async () => pollAction(runId))
.setProgressAction((data: Simulation) => {
if (data.progress) {
Expand All @@ -77,7 +78,11 @@ const getStatus = async (runId: string) => {
return pollerResults;
}
if (pollerResults.state !== PollerState.Done || !pollerResults.data) {
console.error(`Funman: ${runId} has failed`, pollerResults);
console.error(`Funman: ${runId} has failed with state=${pollerResults.state}`, pollerResults);
if (pollerResults.state === PollerState.ExceedThreshold) {
useToastService().error('Funman polling exceeded', 'Refresh page if you want to resume polling', 8000);
}
}
return pollerResults;
};
Expand All @@ -94,12 +99,11 @@ watch(
const response = await getStatus(id);
if (response.state === PollerState.Done) {
addOutputPorts(id);
const state = _.cloneDeep(props.node.state);
state.inProgressId = '';
state.currentProgress = 0;
emit('update-state', state);
}
const state = _.cloneDeep(props.node.state);
state.inProgressId = '';
state.currentProgress = 0;
emit('update-state', state);
},
{ immediate: true }
);
Expand Down
2 changes: 1 addition & 1 deletion packages/client/hmi-client/src/types/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,8 @@ export interface ModelUnit {

export interface GroundedSemantic {
id: string;
name?: string;
grounding?: ModelGrounding;
name?: string;
description?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public ResponseEntity<Simulation> createValidationRequest(
);

final TaskRequest taskRequest = new TaskRequest();
taskRequest.setTimeoutMinutes(30);
taskRequest.setTimeoutMinutes(45);
taskRequest.setType(TaskType.FUNMAN);
taskRequest.setScript(ValidateModelConfigHandler.NAME);
taskRequest.setUserId(currentUserService.get().getId());
Expand Down

0 comments on commit da98267

Please sign in to comment.