eraseDeployment method

Future<void> eraseDeployment()

Erase study deployment information cached locally on this phone.

Implementation

Future<void> eraseDeployment() async {
  if (studyDeploymentId == null) return;

  try {
    info(
        "$runtimeType - Erasing deployment cache for deployment '$studyDeploymentId'.");
    await Persistence().eraseDeployment(studyDeploymentId!);

    final name = await Settings().getCacheBasePath(studyDeploymentId!);
    await File(name).delete(recursive: true);
  } catch (exception) {
    warning('Failed to delete deployment - $exception');
  }
}