Skip to content

Commit

Permalink
Closes #1027
Browse files Browse the repository at this point in the history
  • Loading branch information
Spurs20 committed Jan 20, 2022
1 parent 76c5980 commit e571cc1
Showing 1 changed file with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,22 @@ export default class LoadingPage extends React.Component<LoadingPageProps, Loadi
* @memberof LoadingPage
*/
private updateProgress = (): void => {
client
.get_model_fetch(this.props.modelId)
.then((model: any) => {
if (model.hasOwnProperty("progress") && model.hasOwnProperty("state")) {
this.setState({ progressBarProgress: model.progress, modelState: model.state }, () => {
if (this.state.progressBarProgress === 100) {
window.location.reload(true);
}
});
}
})
.catch((err: any) => {
alert(`error retrieving the model ${err}`);
});
if(this.state.jobStatus != "FAILED") {
client
.get_model_fetch(this.props.modelId)
.then((model: any) => {
if (model.hasOwnProperty("progress") && model.hasOwnProperty("state")) {
this.setState({ progressBarProgress: model.progress, modelState: model.state }, () => {
if (this.state.progressBarProgress === 100) {
window.location.reload(true);
}
});
}
})
.catch((err: any) => {
alert(`error retrieving the model ${err}`);
});
}
};
/**
* callback for the model that establishes connection to the remote server
Expand Down Expand Up @@ -161,6 +163,8 @@ export default class LoadingPage extends React.Component<LoadingPageProps, Loadi
this.setState({ pullCalled: 1 }, () => this.pullHPCData());
}
break;
case "FAILED":
this.cancelJob();
default:
console.log("Unknown state");
break;
Expand All @@ -183,7 +187,7 @@ export default class LoadingPage extends React.Component<LoadingPageProps, Loadi
if (!this.state.sessionExists) {
this.setState({ modelShow: true });
($(`#${this.state.modalId}`) as any).modal("show");
} else if (this.state.progressBarProgress < 50) {
} else if (this.state.progressBarProgress < 50 && this.state.jobStatus != "FAILED") {
this.checkRemoteJob();
}
}
Expand Down

0 comments on commit e571cc1

Please sign in to comment.