tryDeployment method

  1. @mustCallSuper
Future<StudyStatus> tryDeployment(
  1. Study study
)

Verifies whether the device is ready for deployment of the study runtime identified by study, and in case it is, deploys. In case already deployed, nothing happens.

Implementation

@mustCallSuper
Future<StudyStatus> tryDeployment(Study study) async {
  StudyRuntime runtime = repository[study]!;

  // Early out in case this runtime has already received and validated deployment information.
  if (runtime.status.index >= StudyStatus.Deployed.index) {
    return runtime.status;
  }

  return await runtime.tryDeployment();
}