recover method

  1. @override
Future<void> recover(
  1. LocalDatabase localDatabase
)
override

Checks that everything is fine and fix things if needed + if possible.

To be run systematically for each task. Especially useful for transient files: if a user closed the app before successfully completing the upload task, the transient file - that is just a static variable - won't be there at app restart. Unless you recover.

Implementation

@override
Future<void> recover(LocalDatabase localDatabase) async {
  final File? transientFile = _getTransientImage();
  if (transientFile == null) {
    await putTransientImage(localDatabase);
  }
}