getStudyDeploymentStatus method
Get the deployment status for the study from the deployment service.
This updates the deploymentStatus and sets the study status accordingly.
Returns null if the deployment status could not be retrieved from the deployment service.
Implementation
Future<StudyDeploymentStatus?> getStudyDeploymentStatus(Study study) async {
StudyDeploymentStatus? deploymentStatus;
// try to get the deployment status from the deployment service
try {
deploymentStatus = await deploymentService.getStudyDeploymentStatus(
study.studyDeploymentId,
);
} catch (error) {
study.deploymentError(
"$runtimeType - Could not get deployment status with id '${study.studyDeploymentId}' "
"from the deployment service: $deploymentService."
"\nError: $error",
);
deploymentStatus = null;
}
// Update study with new deployment status.
if (deploymentStatus != null) {
study.deploymentStatusReceived(deploymentStatus);
}
return deploymentStatus;
}